0% completed
In this lesson, you'll learn how to create tables within tables to organize complex data. Nested tables help you display multi-dimensional data or grouped information clearly, by embedding one table inside another.
HTML nested tables are tables placed inside a cell of an outer table. This technique is useful when you want to:
The basic idea is to include a <table>
tag inside a <td>
cell of an outer table.
<table> <tr> <td> <!-- Outer cell content --> <table> <!-- Nested table content --> </table> </td> </tr> </table>
<table>
organizes the primary data.<table>
(nested table) is embedded within a <td>
cell and can have its own rows and cells.Below is a complete HTML example that demonstrates a nested table. In this example, the outer table displays product information, and one of the cells contains a nested table showing detailed specifications.
Explanation:
<tr>
tag.<td>
cell.<th>
tags) for specifications and the corresponding values.With nested tables, you can effectively present multi-dimensional data, making your web pages more structured and easier to understand.
.....
.....
.....