- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi,
Suppose you would have about 20 tables, each table has 3 tr and 5 td. So in total you would have 300 td (table cells). Each cell would contain a (different) background img, so 300 png img in total . My question: What would be best for faster loading time, like this:
CSS:
.cla td{
background-image:url(file/image.png);
background-repeat: no-repeat;
background-position: 12px 8px;
border: solid 1px #ccc;
cursor:pointer;
}
HTML:
td class=”cla”
or like this:
CSS:
.cla td{
background-repeat: no-repeat;
background-position: 12px 8px;
border: solid 1px #ccc;
cursor:pointer;
}
HTML:
td class=”cla” style=”background-image:url(file/image.png);”
So what is faster? I know normally it doesn’t matter. But I believe their could be a tiny small difference in the way the browser reads in the code and this tiny difference would multiply itself by (more than) 300 times AND THAN it could make a difference.
Hi @TT_Mark
I think putting an img as a background is the only solution for me, I asked this question on stackoverflow: http://stackoverflow.com/questions/6800246/keep-table-cell-dimensions
And all the images are different anyway..
First, are you using the tables for appropriate purposes or for your entire layout?
Hi @ChristopherBurton
I’m not using them for my layout. So I guess for appropriate purposes. (but I have to say that I will keep most tables ”hidden” on my server and call them dynamically with Jquery (load event) after a user clicks something. But still I want to be on the safe side when it comes to loading time. I have read somewhere (-forget where-) that it DOES make a difference in how the code is written (css to html and vice versa) when it comes to loading time)