Front-End-HTML-table elements,-HTML-Table Elements
HTML element classification-Table Elements
0. <table>: Define a table.
<Caption>: Define the table title. The caption element follows the table element. Each table can only define one title, and the title is centered on the table.
<table border="1"> <caption>Monthly savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr></table>
<Thead>: defines the table header. This element is used to combine the table header content.
<Tbody>: used to group the body content in a table.
<Tfoot>: used to group the content of the table note (footer) in the table.
<Tr>: Define rows in the table.
<Th>: defines the header cells in the table.
<Td>: defines the standard cells in the table.
<table border="1"> <thead> <tr> <th>Month</th> <th>Savings</th> </tr> </thead> <tbody> <tr> <td>January</td> <td>$100</td> </tr> <tr> <td>February</td> <td>$80</td> </tr> </tbody> <tfoot> <tr> <td>Sum</td> <td>$180</td> </tr> </tfoot></table>
<Colgroup>: combines columns in a table to format them. It can only be used in table elements.
<Col>: defines attribute values for one or more columns in a table. You can only use the col element in the table or colgroup element.
<table border="1"> <colgroup> <col span="2" style="background-color:red"> <col style="background-color:yellow"> </colgroup> <tr> <th>ISBN</th> <th>Title</th> <th>Price</th> </tr> <tr> <td>3476896</td> <td>My first HTML</td> <td>$53</td> </tr></table>
Note that in H5, The col and colgroup elements only support the attribute span and must be nested before all the child elements in the table element.