Table or Div

T

Tor Inge Rislaa

Table or Div



Is there a common rule or "best practice" concerning when to use TABLE and
when to use DIV tag's when designing a master page? I am designing a master
page with a header and footer and in between I have a menu area to the left
and a content area to the right. What would be the best way to design this
page?



TIRislaa
 
J

John Timney \(MVP\)

go div every time is my rule, layout with tables is hard work...but you cant
beat tables for backward compatibility so theres no right or wrong way! If
your into seperation of the html and the presentation through CSS then its
often seen as best practivc to use divs and css for layout and style as
opposed to tables and css, or nested styles and fonts for example.

.....theres a thread a few threads down entitled "2 divs on same line" - go
take a read of how to lay out what your after using master pages

--
--
Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
T

Tor Inge Rislaa

Thank you!

John Timney (MVP) said:
go div every time is my rule, layout with tables is hard work...but you
cant beat tables for backward compatibility so theres no right or wrong
way! If your into seperation of the html and the presentation through CSS
then its often seen as best practivc to use divs and css for layout and
style as opposed to tables and css, or nested styles and fonts for
example.

....theres a thread a few threads down entitled "2 divs on same line" - go
take a read of how to lay out what your after using master pages

--
--
Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
M

Mike

Tor Inge Rislaa said:
Table or Div
Is there a common rule or "best practice" concerning when to use TABLE and
when to use DIV tag's when designing a master page? I am designing a
master page with a header and footer and in between I have a menu area to
the left and a content area to the right. What would be the best way to
design this page?

Yep, as John recommends, go with divs. Apart from the "semantic web" reason
that John touched on, if you ever need help on a CSS matter and post a URL
to a page laid out using tables in a CSS newsgroup, you will get absolutely
slaughtered by the regulars there.

Not that that has ever happened to me, of course....

Mike
 
K

Kevin Spencer

I tend to mix and match tables and divs. Each has their place. Because a div
is a block-level element, it is designed to either appear in the normal flow
of the page on a line by itself, or using absolute positioning
("layer-style"). Doing layout elements. such as 2 rectangles that should
always be side-by-side, using divs is, as the "2 divs on same line" thread
points up, problematic. However, tables, which are also block-level
elements, but may contain many boxes in the same row, are by nature fixed
internally. There is no easy way to change the internal layout of rows and
columns inside tables. So, when doing boxes as containers, divs are the
perfect tool, while using tables is perfect for doing multiple boxes that
are tabular relative to one another.

Tables have their CSS issues, of course, but many of these can be solved by
putting a table inside a div when necessary. However, I certainly would not
use a table or tables for doing general layout.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

In case of Minimalism, break Philip Glass.
 

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

Top