You are here:About>Computing & Technology>Web Design / HTML
About.comWeb Design / HTML
Newsletters & RSSEmail to a friendSubmit to Digg

Nested Tables and Page Download Speed

From Jennifer Kyrnin,
Your Guide to Web Design / HTML.
FREE Newsletter. Sign Up Now!

Do Your Pages Take Too Long to Download Because of Tables?

A single table on a Web page will not slow downloading. But the moment you put one table within another table, it gets more complicated for the browser to render, and so the page loads more slowly.

Nested Tables for Page Layout

When you create a page with tables, keep in mind that the more tables that are within tables, the slower the page will load. Normally, when a page loads the browser starts at the top of the HTML and loads it sequentially down the page. However, with nested tables, it has to find the end of the table before it can display the entire thing.

Also, if you're trying to write valid XHTML, tables should not be used for layout at all. Tables are for tabular data (such as spreadsheets) not for layout. Instead you should use CSS for layout - this renders more quickly and creates valid XHTML.

Table Design

If you design a table with multiple rows, it can often load more quickly if you write each row as a separate table. For example, you could write a table like this:

<table width="100%">
<tr><td colspan="2">
top row
</td></tr>
<tr><td>
left column
</td><td>
right column
</td></tr>
</table>

But if you wrote the same page as two tables, it would appear to load more quickly, because the browser would render the first and then render the second:

<table width="100%">
<tr><td colspan="2">
top row
</td></tr>
</table>
<table width="100%">
<tr><td>
left column
</td><td>
right column
</td></tr>
</table>

Next Page > Frames and Speed > Page 1, 2, 3

Previous Features

 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.