View Full Version : Are Tables Overrated?

04-26-2008, 05:53 AM
I was just working on this table, that scrolls inside a div and contains a bunch of images. I was having problems getting the photos aligned the way I wanted and I got to thinking...

...If you were to write your own "Table" object that consisted of an array of divs, each div stacked side by side, vertically and/or horizontally to make up the "Table" (each cell would be a div), well... would it make sense? What would the tradeoff's be as far as ease of manipulation (tables are weird sometimes and are not 100&#37; browser compatible), and as far as browser performance? Is a div that has 1000 divs in it going to be less efficient than a table with 1000 single-column rows? I end up cramming stuff in the cell's innerHTML or setting a bunch of it's attributes, so would it be less efficient if that was just a <div> instead of a <td>? Feels like I would have more control over behavior and appearence.

Can someone save me some time and convince me that this is a dumb idea? Have I had too much vino tonight?

04-26-2008, 06:32 AM
It will probably be slower. If anything, tables will work in js-disabled browsers.

04-26-2008, 07:29 AM
I'm building my own "framework" - yet another DOM wrapper - so I'm continuing to really understand how the browsers work and how HTML and the DOM get processed. So... if anyone can answer the question of why DIVs would be slower that would be most appreciated. Regardless, I think I'll go ahead and try a little experiement - just scroll 1000 divs with images in an enclosing container div - compare it to the <table>.

Dang. I gots to learns everything the hard way.

04-26-2008, 07:49 AM
Eh, the <table> is working fine. nevermind.