Previous Section  < Day Day Up >  Next Section

7-10 Nesting Tables in Standard View

By merging cells, you can create complex tables that offer precise control over your layouts. If you use Layout mode to create a detailed, handcrafted design, you'll see how Dreamweaver can generate complex tables using this technique.

But on the Web, simpler is usually better. Sometimes, instead of spending time and effort chopping up and merging cells to create a certain look, the best solution is to nest tables梡lacing a table within a table梚nstead of creating one complex table (see Figure 7-25).

Since a table cell acts just like a mini document, you can put anything that you'd normally place on a page inside a cell梘raphics, text, links and, yes, even tables. Simply click a cell and use one of the techniques described earlier to add and format the table.

You can even place more than one table in a single cell. In Figure 7-25, for example, three tables are nested in the right-hand cell of the main table. They're in the flow of the cell contents, separated into individual paragraphs. By compartmentalizing and aligning information, nested tables make complex Web pages easier to both build and edit.

The page at top looks complicated, but in Dreamweaver, it breaks down to a series of simple tables. The outside table (A) is a one-row, three-column table with a series of nested tables (B, C, D, E). The first cell contains another basic table (B), which has twelve rows and one column. Using alternating colors for each cell helps set off the information inside. The third column of the primary table holds the main content of the page; three tables (C, D, E) are placed within the flow of the cell.

One nice trick: Use the Align property of a table to create a "floating" sidebar within the normal flow of text. The announcements table here, for instance, is aligned to the right, while text in the cell wraps around it. Note that aligning a table like this is only possible in Standard view.

Be aware that there are some limits to nesting tables. For example, it's best not to nest more than three tables deep; in other words, a table inside of a table inside of a table. While most browsers can recognize and draw tables that are more deeply nested, such complexity can be difficult to render, resulting in pages that are slow to load, especially on slower computers.

    Previous Section  < Day Day Up >  Next Section