Chapter 9: Tables
index | previous | next

Nesting One Table in Another

In some circumstances, you’ll need to put one table inside another. For instance, in our example, we want to insert the multicolumn text table with cell spacing into a table that has no spacing between the columns.

To nest one table in another:

  1. Create the inner table.
  2. Create the outer table. Determine which cell of the outer table will hold the inner table and type placeholder (or some other easily identifiable text) there as a placeholder.
  3. Test both tables separately to make sure they look the way you want them to.
  4. Replace the word placeholder with the inner table by copying and pasting.

Tips

  • The width of the cell that contains the inner table should match the width of the inner table. Be sure to also set the widths of all of the surrounding cells as well as the outer table.
  • Creating the tables separately before nesting them helps pinpoint where problems may lie, should they occur.
  • Only nest tables where it’s absolutely necessary. They can slow down a browser considerably or even make it crash.
  • You can also use   in any cell that should remain empty. Otherwise, it may not display at all.
Figure 9.28 Construct the outer table separately, leaving an empty cell where the inner table should go. Notice how the width of the table and of each individual cell is set properly.
Figure 9.29 The outer table is 600 pixels wide. The space for our inner table is 480 pixels wide. It’ll fit perfectly.
previous | next