I'm fairly experienced when it comes to writing sites, have written quite a few but mainly write background code. I've just started picking up a new project and I'm caught up in the massive debate that is DIV vs TABLE, and I honestly cannot tell why everyone is raving about DIV tags.
Maybe someone here can shed some light.
The arguments I've seen so far are:
Flexibility - Supposedly its faster to change layout using DIVs and css... but what if I'm not looking to change my style continuously? I'm going to have a lot of information packed into each page form various places and rearranging it will be a task no matter what method I use.
Tables are deprecated - Not true, they probably never will be as they are a basic principle in HTML.
DIVs are faster - Given, but the bottleneck will be the masses of background execution on the server and delivery of the data. A fraction of a second for a table to render isn't a concern to me.
DIVs are easier to maintain - This I really don't get. You now have to look at both the HTML and the CSS to determine how each element is drawn, and with the ridiculous amounts of both I will be using I can imagine a DIV structure will be a nightmare to keep track of.
A simplified diagram of What I will be looking to make is:
----------- ----------------------------------------------
| Heading | | Heading |
|---------| |--------------------------------------------|
| User | | Info |
| Info | | |
| | |--------------------------------------------|
----------- | Javascript Search Form |
| (Interactive) |
----------- |--------------------------------------------|
| Heading | | Head 1 | Head 2 | Head 3 | Head 4 | Head 5 |
|---------| |--------------------------------------------|
| | |Category |
| Menu | |--------------------------------------------|
| | | Data | Data | Data | Data | Data |
| | | Data | Data | Data | Data | Data |
| | | Data | Data | Data | Data | Data |
| | | Data | Data | Data | Data | Data |
| | | Data | Data | Data | Data | Data |
| | |--------------------------------------------|
| | |Category |
| | |--------------------------------------------|
----------- | Data | Data | Data | Data | Data |
| Data | Data | Data | Data | Data |
| Data | Data | Data | Data | Data |
| Data | Data | Data | Data | Data |
| Data | Data | Data | Data | Data |
| Data | Data | Data | Data | Data |
| Data | Data | Data | Data | Data |
|--------------------------------------------|
|Category |
|--------------------------------------------|
| Data | Data | Data | Data | Data |
| Data | Data | Data | Data | Data |
| Data | Data | Data | Data | Data |
| Data | Data | Data | Data | Data |
| Data | Data | Data | Data | Data |
----------------------------------------------
The entire thing needs to be centered.
Now I figured a mix of DIV and table would suit, so an overall content container <div>, 2 content <div>s (Left and Main) and then a couple of sub tables.
Before even getting to the stage of developing I've run into a problem: I can't center the overall <div> tag, aligning it with CSS sets every child element to centered by default but doesnt center the contents.
How would you guys proceed, and why?
I'm beginning to think this whole div vs table argument is one of those 'who cares' kind of arguments where neither side is more right or wrong than the other. All I know is, If i want to do this with purely tables I can do it in about 30 seconds, but if I wan't to attempt to use DIVs then it's going to be a long night.

New Topic/Question
Reply



MultiQuote










|