Layout: Divs or Tables?

G

Guest

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?
 
M

Mark Fitzpatrick

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.
 
G

Guest

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.
 
E

Eliyahu Goldin

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
 
M

Mark Rae

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... :)
 
P

Peter Bradley

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 said:
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 said:
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?
 
P

Patrice

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top