Tables and CSS

In Chapter 4, "Advanced HTML Optimization," you learned how to speed up tables with the CSS2 table-layout:fixed; property and colgroup and col elements. Another technique you can use for tiny tables is to use CSS to style table cell background colors instead of embedding bgcolor s everywhere. So instead of this:

 <table bgcolor="#ffcc00">  <tr bgcolor="somecolor"> <td>...</td> <td bgcolor"anothercolor">...</td> 

do this:

 .x{background:#fc0}.y{background:#ffed9a}.z{background:#fff3ac}  <table class="x"> <tr class="y"> <td>...</td> <td class="z">...</td> 

All version 4 browsers and higher support this technique.


Speed Up Your Site[c] Web Site Optimization
Speed Up Your Site[c] Web Site Optimization
ISBN: 596515081
Year: 2005
Pages: 135 © 2008-2017.
If you may any questions please contact us: