markjoe Posted September 25, 2008 Share Posted September 25, 2008 I have seen randomly on the web people saying "never use tables for layout!". Trouble is they never seem to go into any reasoning. I have pages with a table-like layout with tables and some with divs. Either seem to work fine. (actually I find that sometimes using tables is quicker and easier, mostly report-type pages) Question is, does anybody know any actual reason(s) to not use tables for basic layout? Keep in mind that when I use tables, it is plain table, tr, td elements with CSS (not using the deprecated attributes). Quote Link to comment https://forums.phpfreaks.com/topic/125853-solved-general-page-layout-tables-vs-divs/ Share on other sites More sharing options...
CroNiX Posted September 25, 2008 Share Posted September 25, 2008 Heres a short read from the w3c (the group that sets the web standards) http://www.w3.org/2002/03/csslayout-howto If you look at the definition of what a table is from the w3c, it is to layout tabular data. A website layout is not tabular data. A chart showing a list of peoples name, age, phone, etc. IS tabular data. If you layout a website using a table, you are not following web standards and many companies want (obviously) to follow standards because it is a reflection of the company. Quote Link to comment https://forums.phpfreaks.com/topic/125853-solved-general-page-layout-tables-vs-divs/#findComment-650818 Share on other sites More sharing options...
sKunKbad Posted September 25, 2008 Share Posted September 25, 2008 The real problem with a table based layout is that the order in which your content is provided to a screen reader, search crawler, etc. is different than with a pure CSS layout using divs. You know that you can float, and use absolute positioning with CSS and divs, and this is a good thing because you can put your real content at the top of your document (even if it appears lower on screen). Take a look at my website with all style turned off, or with images turned off, or both. The content that exists behind the style and images is what makes the page what it is. Quote Link to comment https://forums.phpfreaks.com/topic/125853-solved-general-page-layout-tables-vs-divs/#findComment-650853 Share on other sites More sharing options...
markjoe Posted September 25, 2008 Author Share Posted September 25, 2008 Thanks for the info. I guess in most cases I am using tables and divs correctly then, other than that one index page I don't want to re-do. I do sometimes have a tendancy to fall back on tables rather quickly when I have I don't get the results I want in CSS right away (hangs head in shame). Quote Link to comment https://forums.phpfreaks.com/topic/125853-solved-general-page-layout-tables-vs-divs/#findComment-650860 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.