HTML element Classification-table elements
0. <table>: Define the table.
<caption>: Defines the table title. After the caption element follows the table element, each table can define only one title, with the title 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 contents.
<TBODY>: Used to group the main contents of a table.
<TFOOT>: Used to group the contents of a table note (footer) in a table.
<tr>: Defines the rows in the table.
<TH>: Defines a table header cell in a table.
<TD>: Defines a standard cell in a 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. Can only be used in table elements.
<col>: Defines a property value for one or more columns in a table. You can only use the COL element in a 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>
It is important to note that in H5, the col element, the Colgroup element only supports attribute span and must be nested before all child elements within the table element.
Front-end-html-table elements