CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2007
    Posts
    29

    positioning of controls

    Hi,

    I would like to know what "best practise" is when positioning controls within a website. Is the absolute positioning considered to be "out of date", and is constructing websites with tables, to organize controls, also considered outdated?

    How do you generally position your controls when the contents of a page is static (not using datagrids and other expandable items)?

    thanks

  2. #2
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: positioning of controls

    I used tables and CSS to position content when I do webpages.
    ===============================
    My Blog

  3. #3
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: positioning of controls

    Now - I'm not a web-designer myself, but the way it seems to be done these days (from what I've picked up from our own designers) is using div/span and similar to position elements and less so using tables, unless when presenting a table of data of course.

    Some focus a lot on so-called semantic HTML as well - meaning making sure lists are in a list-tag, headlines being headlines and what not. Mostly that seems to be just "buzzword" still, but the longer term perspectives in it might warrant a closer look. (Until it conflicts with coding )

    It is also common in these days of varrying screen size to make sure your design looks the same if using a larger screen, meaning the content is positioned in the center of the screen.

  4. #4
    Join Date
    Nov 2007
    Posts
    29

    Re: positioning of controls

    Thanks for the replies. I've also seen, when browsing the web on this issue, that div/span seems to be the way to go these days. Unfortunately that approach seems to cause a lot more work than using tables.

    Well, I've better get started then!

    But one more thing before I go...

    Do you position the divs and spans using css and relative positioning? <div style="position:relative..."> or do you use padding?
    Last edited by marjoh; November 3rd, 2009 at 04:54 AM. Reason: Forgot one thing

  5. #5
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: positioning of controls

    div/spans is more work - at first.
    But makes it easier to reuse the same layout for multiple pages and to change the style sheet then having to rework tables.

    For example, you can have a list/gallery type function where the only thing that changes between the two listing methods is another stylesheet applied to the html/code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured