Next topic: HTML Tables.
HTML Tables
Tables are used to display data in a structured format.
Table Syntax
Table Elements
<table>: Defines the table<tr>: Defines a table row<th>: Defines a table header cell<td>: Defines a table data cell
Table Attributes
border: Specifies the table border widthcellpadding: Specifies the space between cellscellspacing: Specifies the space between cells and borders
Example Table
Table Best Practices
- Use tables for tabular data, not for layout.
- Use
<th>for header cells and<td>for data cells. - Use
border,cellpadding, andcellspacingattributes to style the table.
Tags
html coding