Should You Use HTML Divisions or Tables?

Article by Miguel Leiva-Gomez (774 pts ) , published Sep 24, 2009

Ever since the DIV tag and TABLE tag in HTML started coexisting in nature, there have been debates as to whether DIV or TABLE are better. The discussion has not ended, and probably never will. So, which one of the two is better?

The Debate

Although HTML may seem simple, several of its elements have been discussed since its beginning. On Internet sites, everything you see is a result of clever HTML output. The more elegant the HTML, the easier the page will be to edit. The governing force behind most pages is the page structure, which can be outlined by tables or divisions. The difference between the two are that tables divide the page in pieces and divisions create units that float around the page, depending on how you declare them.

Advantages of Tables

When using tables, there are two directions to go: the right one and the wrong one. The right way to use tables is when trying to depict tabular data, such as statistics on a page. However, there is also a wrong way to use them. If you intend to design your entire website using tables, you will be putting yourself through unnecessary amounts of trouble and limitations. Your capabilities will not reach their full potential if you only put your focus on tables. The temptation to do so comes from the fact that it is very easy to use tables to design a layout. Ultimately, you end up limiting yourself a lot if you keep thinking this way.

Advantages of Divisions

Divisions are the new revolutionary hype in the web community. These elements can be placed virtually anywhere you want them without exerting yourself so much. You can literally pick any fixed point on the webpage and put a div with any corner starting on it. Also, divs reduce the amount of code necessary to efficiently create a design. This serves as an advantage to people renting servers for hosting, since using divisions will reduce the amount of bandwidth used each time a user opens a page. The concept of divisions was created specifically for design, and most modern web pages use divs in combination with other HTML and CSS and Flash tricks to create their modernized look and feel. This counts when you have 100 or more visitors per day. However, for tabular data, divs really don't serve much more of a purpose than tables do. Also, you have to bother with CSS if you really want to dive into divs.

Which is Better?

The ultimate conclusion to the debate is that divs and tables are good for their own specific purposes. If you aim for a strong web design, divs will make you a maestro of web design. If you are aiming to simply make a page that displays tabular data (data in tables), then you are much better off giving divs and CSS a break and employing the use of tables in your code. Keeping these things in mind will give you less headaches!

 
Subscribe to Web Development
RSS
Get free weekly updates, directly to your inbox.
Browse Web Development