Layout: Divs or Tables?

Discussion in 'ASP .Net' started by =?Utf-8?B?Tkg=?=, Mar 14, 2007.

  1. Hi,

    What do you recommend for defining the layout of an asp.net 2.0 page?
    Leaving masterpages and user controls aside for the moment is the use of
    tables or Divs the best approach?

    I have been using tables so far to define the layout and use % based sizes
    so things stretch or shrink to fit the screen size. It works fine.

    I read about using DIVs and saw this approach being used in some MS Asp.net
    design templates. They use divs and use CSS to handle the layout.

    Which is best, does it matter at all?
     
    =?Utf-8?B?Tkg=?=, Mar 14, 2007
    #1
    1. Advertising

  2. To be honest, I prefer the table approach. You can do great things with CSS
    positioning, but it can be easy to create strange visual errors. Not to
    mention that it always seems that after you design with CSS there's at least
    one browser you didn't check with that has a visual error :)

    I like to use the tables for the general structure and often rely on the
    divs if I need something special, such as hideable text through javascript,
    etc.. I still use CSS in my app, I've just kept away from the absolute
    positioning as it just seems to take so much time to get it right compared
    to tables.


    --
    Hope this helps,
    Mark Fitzpatrick
    Former Microsoft FrontPage MVP 199?-2006

    "NH" <> wrote in message
    news:D...
    > Hi,
    >
    > What do you recommend for defining the layout of an asp.net 2.0 page?
    > Leaving masterpages and user controls aside for the moment is the use of
    > tables or Divs the best approach?
    >
    > I have been using tables so far to define the layout and use % based sizes
    > so things stretch or shrink to fit the screen size. It works fine.
    >
    > I read about using DIVs and saw this approach being used in some MS
    > Asp.net
    > design templates. They use divs and use CSS to handle the layout.
    >
    > Which is best, does it matter at all?
     
    Mark Fitzpatrick, Mar 14, 2007
    #2
    1. Advertising

  3. I agree about the absolute positioning, I remember the first web app I built
    in asp.net 1.0 and used the gridlayout option on the page. I thought it was
    great until I viewed the web page from a different users monitior that had a
    different display resolution.

    I suppose you learn from your mistakes.

    "Mark Fitzpatrick" wrote:

    > To be honest, I prefer the table approach. You can do great things with CSS
    > positioning, but it can be easy to create strange visual errors. Not to
    > mention that it always seems that after you design with CSS there's at least
    > one browser you didn't check with that has a visual error :)
    >
    > I like to use the tables for the general structure and often rely on the
    > divs if I need something special, such as hideable text through javascript,
    > etc.. I still use CSS in my app, I've just kept away from the absolute
    > positioning as it just seems to take so much time to get it right compared
    > to tables.
    >
    >
    > --
    > Hope this helps,
    > Mark Fitzpatrick
    > Former Microsoft FrontPage MVP 199?-2006
    >
    > "NH" <> wrote in message
    > news:D...
    > > Hi,
    > >
    > > What do you recommend for defining the layout of an asp.net 2.0 page?
    > > Leaving masterpages and user controls aside for the moment is the use of
    > > tables or Divs the best approach?
    > >
    > > I have been using tables so far to define the layout and use % based sizes
    > > so things stretch or shrink to fit the screen size. It works fine.
    > >
    > > I read about using DIVs and saw this approach being used in some MS
    > > Asp.net
    > > design templates. They use divs and use CSS to handle the layout.
    > >
    > > Which is best, does it matter at all?

    >
    >
    >
     
    =?Utf-8?B?Tkg=?=, Mar 14, 2007
    #3
  4. This topic was discussed numerous times in this newsgroup. The conclusion
    was if you're more a programmer, tables let you create a robust and
    reasonably good design fast. If you're more a designer, you can express
    yourself more with divs provided you learnt well how to use them properly.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]
    http://msmvps.com/blogs/egoldin
    http://usableasp.net


    "NH" <> wrote in message
    news:D...
    > Hi,
    >
    > What do you recommend for defining the layout of an asp.net 2.0 page?
    > Leaving masterpages and user controls aside for the moment is the use of
    > tables or Divs the best approach?
    >
    > I have been using tables so far to define the layout and use % based sizes
    > so things stretch or shrink to fit the screen size. It works fine.
    >
    > I read about using DIVs and saw this approach being used in some MS
    > Asp.net
    > design templates. They use divs and use CSS to handle the layout.
    >
    > Which is best, does it matter at all?
     
    Eliyahu Goldin, Mar 14, 2007
    #4
  5. =?Utf-8?B?Tkg=?=

    Mark Rae Guest

    "Mark Fitzpatrick" <> wrote in message
    news:ex$1$...

    > To be honest, I prefer the table approach. You can do great things with
    > CSS positioning, but it can be easy to create strange visual errors. Not
    > to mention that it always seems that after you design with CSS there's at
    > least one browser you didn't check with that has a visual error :)
    >
    > I like to use the tables for the general structure and often rely on the
    > divs if I need something special, such as hideable text through
    > javascript, etc.. I still use CSS in my app, I've just kept away from the
    > absolute positioning as it just seems to take so much time to get it right
    > compared to tables.


    Me too.

    CSS layout suddenly became fashionable about a year ago, which made it
    proponents sneer at us poor dummies who still used tables for layout... :)
     
    Mark Rae, Mar 14, 2007
    #5
  6. And CSS positioning allows you to conform to Accessibility Guidelines -
    which may be a legal requirement on you. You can't do that with tables as
    they produce garbage through a screen reader.

    Just my 2c.


    Peter

    "Eliyahu Goldin" <> wrote in
    message news:...
    > This topic was discussed numerous times in this newsgroup. The conclusion
    > was if you're more a programmer, tables let you create a robust and
    > reasonably good design fast. If you're more a designer, you can express
    > yourself more with divs provided you learnt well how to use them properly.
    >
    > --
    > Eliyahu Goldin,
    > Software Developer & Consultant
    > Microsoft MVP [ASP.NET]
    > http://msmvps.com/blogs/egoldin
    > http://usableasp.net
    >
    >
    > "NH" <> wrote in message
    > news:D...
    >> Hi,
    >>
    >> What do you recommend for defining the layout of an asp.net 2.0 page?
    >> Leaving masterpages and user controls aside for the moment is the use of
    >> tables or Divs the best approach?
    >>
    >> I have been using tables so far to define the layout and use % based
    >> sizes
    >> so things stretch or shrink to fit the screen size. It works fine.
    >>
    >> I read about using DIVs and saw this approach being used in some MS
    >> Asp.net
    >> design templates. They use divs and use CSS to handle the layout.
    >>
    >> Which is best, does it matter at all?

    >
    >
     
    Peter Bradley, Mar 14, 2007
    #6
  7. =?Utf-8?B?Tkg=?=

    Patrice Guest

    I'm afraid it won't help much as my personal preference is to use DIVs
    whenever possible but I still use TABLEs for layout when significantly
    easier/faster.

    "NH" <> a écrit dans le message de news:
    ...
    > Hi,
    >
    > What do you recommend for defining the layout of an asp.net 2.0 page?
    > Leaving masterpages and user controls aside for the moment is the use of
    > tables or Divs the best approach?
    >
    > I have been using tables so far to define the layout and use % based sizes
    > so things stretch or shrink to fit the screen size. It works fine.
    >
    > I read about using DIVs and saw this approach being used in some MS
    > Asp.net
    > design templates. They use divs and use CSS to handle the layout.
    >
    > Which is best, does it matter at all?
     
    Patrice, Mar 14, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rich
    Replies:
    0
    Views:
    756
  2. Replies:
    1
    Views:
    648
    John Timney \(MVP\)
    Jun 19, 2006
  3. ThunderMusic
    Replies:
    6
    Views:
    461
    ThunderMusic
    Sep 28, 2006
  4. Carl Gilbert

    Page layout using DIVs and CSS

    Carl Gilbert, Feb 9, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    427
    Carl Gilbert
    Feb 12, 2007
  5. maya
    Replies:
    4
    Views:
    265
Loading...

Share This Page