Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    May 2007
    Location
    Manteca, CA
    Posts
    219
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Are Tables Overrated?

    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?
    Last edited by snoodle; 04-26-2008 at 05:58 AM.

  • #2
    Regular Coder
    Join Date
    Jun 2007
    Location
    USA
    Posts
    527
    Thanks
    26
    Thanked 74 Times in 72 Posts
    It will probably be slower. If anything, tables will work in js-disabled browsers.
    Trinithis

  • #3
    Regular Coder
    Join Date
    May 2007
    Location
    Manteca, CA
    Posts
    219
    Thanks
    4
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Regular Coder
    Join Date
    May 2007
    Location
    Manteca, CA
    Posts
    219
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Eh, the <table> is working fine. nevermind.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •