Module 6 focuses on the creation and styling of tables in HTML. Here's a detailed overview of the key concepts:
<table>
element): Tables are created using the <table>
element. This element serves as the container for all table-related content.<tr>
) and cells (<td>
, <th>
): Within the <table>
element, rows are defined using the <tr>
element, and each row contains cells defined by either <td>
(table data) or <th>
(table header) elements.<th>
element, provide labels for each column or row in a table. Additionally, tables can have captions, which provide a brief description or title for the entire table.Tables are commonly used for displaying tabular data such as schedules, product listings, or statistical information. Proper use of table elements and attributes ensures accessibility and compatibility with various devices and screen sizes.
Here's an example of a simple table:
Name | Age | Country |
---|---|---|
John | 25 | USA |
Emily | 30 | Canada |
David | 22 | UK |
For more advanced table styling and functionality, CSS and JavaScript can be used to customize the appearance and behavior of tables on web pages.