TechTalks from Nitin

August 26, 2007

Page Layout <TABLE> or <DIV>

Filed under: CSS — TheOne @ 8:50 am

So, here i am with my first techtalk.

Today’s question is whether a webdesigner should use tables or div(layers).

Every web designer comes to this question, and it becomes harder to decide. Here I am with some of the points which will definetely help you in deciding layout strategy for your site.

1. My personal experience says it is easier to MAINTAIN or REDESIGN a website with a div(layers) only site in long run.

2. Separation of Structure and Content via CSS i.e., div(layers) makes things more organized.

3. Tables are only meant for tabular data, they are not meant for Page Layout.

4. It is a proven fact that CSS layout is always smaller(in size) than to <table> tags. Hence smaller page size.

5. Its more a question of convenience. With Div tags and CSS, you can write the CSS once and then never worry about the styling of your site again, and then spend your time entirely on content. With tables, you have to redo things every time content changes significantly(in certain ways). In this way CSS is much more efficient.

This was all about study now comes the final verdict.
K.i.S.S. is more important than table or divs. So remember just KISS.
K.i.S.S. = Keep It Simple Stupid

Moreover, I would recommend tables for sites with little content and/or few changes.
Divs(Layers) are recommended to use for DHTML and lots of ‘active’(web 2.0 sites) content that needs to be hidden and shown depending on users actions.

I Hope this will help you in deciding the layout for your site.

Blog at WordPress.com.