Topic: DIVs or Tables?

The pro of Div tags opposed to tables seems to be that less code is required to achieve the same effect. Up until a while ago I didn't realize that punBB used tables for the category/forum cascading.

Tables are still used in a wide array of websites out there, and one of the pros is the compatibility. I couldn't find a browser that had issues showing phpBB layouts with tables, all the way back to Netscape Communicator. Yet punBB didn't display properly at all in some ancient ones.

I don't HAVE a signature, ok?

2

Re: DIVs or Tables?

It has nothing to do with the amount of markup used though that is a bonus for tableless designs. It is all about semantics i.e. using the right tag for the content. For example, if you have a paragraph of text put it in a <p>, if you have a numbered list put it in a <ol>. Tables therefore should only be used for tabular data such as the main sections of the index and viewforum pages and be correctly marked up. Divs have no semantic value at all so they are safe to use for layout; they are invisible in text only view and are ignored by screen readers.

It's also about flexibility. If you use tables for layout then you are stuck with a grid. If you use tableless design then you can shift everything around with css without ever having to touch the markup (in theory). You just try overlapping stuff that is in a table cell. For example, take the board statistics box on the index page. If that used a two column table then you would be stuck with one bunch of stuff on the left and another on the right. With a tabless layout I can change one item in the stylesheet and stack things on top of one another instead.

I wouldn't worry about Netscape, the big debate now amongst developers is whether to dump support for IE5. PunBB will never work in very old browsers for the simple reason they don't understand css. In the end its just a decision whether you want to support the maximum possible browsers or whether to look to the future and be ready for the time when the the likes of NS6 and IE5 are just distant memories.

3

Re: DIVs or Tables?

I still support IE5, seems better behaved than 5.5 & 6 a lot of the time lol

Theres a lot of IE5 out there still, especially in rural areas.

cheers

Re: DIVs or Tables?

Looking backwards and keeping things compatible is hindering the design and development community. If someone out there is still using IE5 it's about time to upgrade.

I don't HAVE a signature, ok?

5 (edited by GregK 2005-06-23 20:40)

Re: DIVs or Tables?

not at all, its called hindered design skills wink


Edit: that sounds a little snippity don't it? smile
In all honesty though, I don't find 5, any harder than 5.5 or 6 to design for really. Rare exceptions...

The 4x family of browsers IS history IMO & good riddance lol