Log in

View Full Version : I thought divs were faster than tables?



iUnknown
09-09-2008, 03:32 PM
Note: This is only in internet explorer, in firefox the way firefox appears faster is it downloads the whole page before making it appear so everything appears at the same time in firefox, rather than as it's downloaded (in internet explorer).

Well, when I had to code part of a layout in divs rather than tables (expandable properly coded of course - not generated) to make it expand accross the width of the screen properly, it ended up being half coded in divs and half coded in tables (reminder: the proper ones, not generated). Whats strange is, although the divs may load a fraction of a second quicker, the images in the tables (whether background of td's/tables or actual images in the tables) loaded faster than the images in the divs.

I'm not saying tables are better than divs and I don't want to start an argument about which is better but I think the argument about how divs load faster shouldn't be such a key point, after all, the divs may load faster but the images in/as a background them don't (the main part of the layout).

What ya gotta say about that divy fans ;):P

Excellent2
09-09-2008, 03:33 PM
It could be because you're loading tables with divs so it's lagging the page.

iUnknown
09-09-2008, 03:36 PM
The divs are higher up the page than the tables so technically should load first. I don't think tables on the same page are lagging it... Lots of layouts coded in divs have one or maybe two tables somewhere in the content or something, that doesn't slow down all the divs/the whole layout.

Excellent2
09-09-2008, 03:37 PM
The divs are higher up the page than the tables so technically should load first. I don't think tables on the same page are lagging it... Lots of layouts coded in divs have one or maybe two tables somewhere in the content or something, that doesn't slow down all the divs/the whole layout.Hmm, you'd think the divs would load on page load then .. any scripts you're running?

iUnknown
09-09-2008, 03:51 PM
Hmm, you'd think the divs would load on page load then .. any scripts you're running?

A javascript to expand an iframe. The inline frame isn't in the divs, it's in the tables.

Funya Chin
09-09-2008, 07:06 PM
Who said they were faster?

iUnknown
10-09-2008, 04:27 PM
Just about everyone who codes in divs and thinks they're better than tables ;)

Invent
10-09-2008, 05:21 PM
Divs always load faster for me (especially with background images).

redtom
10-09-2008, 05:28 PM
Divs always load faster for me (especially with background images).

Yeah its exactly the same for me, normaly.

RYANNNNN
10-09-2008, 05:42 PM
The chances are when you're using div instead of table you use less code. The smaller the file the faster the page is going to be. You're still going to be using the same images so most of the time divs load faster.

Funya Chin
10-09-2008, 05:48 PM
It all depends, it's not like it's set in stone.

Whatever the whether, tables that don't hold tabular data have no respect on the internet.

iUnknown
10-09-2008, 09:08 PM
The divs coding may load faster, but images in them as backgrounds load slower than images in tables. That's my point here :)

craigg.
10-09-2008, 10:35 PM
If you want to take your theory and make it evidence, i suggest you make two pages: one holding one div with a background and another page with a table holding a background. Then, add a php script which catches the load time and then see which one loads faster. There are loads of variables which would mess up your results but it would be interesting to see if you are right.

To be honest, div's and tables are equally efficient if used effectively. Using tables to create a whole website is just a no-no. Tables in holding data is more efficient. There is no law to how you code yet it is good practice to code efficiently.

cunning
11-09-2008, 05:55 AM
Yeah its exactly the same for me, normaly.
Same also.

iUnknown
15-09-2008, 04:50 PM
I don't think your method of testing this would work because it only takes longer to show the images afterwards. The page appears to have fully loaded and a PHP code at the end of the coding would identify it as ending earlier than the time it has taken for the images to show.

craigg.
15-09-2008, 07:51 PM
Ahhh! true true. How about making two pages and then compare the file sizes? That should give an indication.

Source
15-09-2008, 07:55 PM
no, after all it is only text... so they would be the same size most likely. The only real way to test it to use firebug and see how long the page takes to load and render in firefox.

iUnknown
15-09-2008, 09:53 PM
Whats firefox? Will that work? Basically... the loading bar is complete but the images aren't quite ready yet. I don't think any software can really detect something like that.

Decode
16-09-2008, 07:22 AM
You could put some javascript at the top of the page to start a timer, then stop it at the bottom of your page.

Invent
16-09-2008, 09:50 AM
Images have nothing to do with if divs are faster than tables.

Source
16-09-2008, 10:15 AM
Simon's correct, but div's are and should be faster than tables in design as all modern browsers are made to render these things quickly and effectivly - especially google chrome with their modified version of Firefox's rendering engine.

RYANNNNN
16-09-2008, 02:07 PM
sigh
...

Want to hide these adverts? Register an account for free!