Not long ago, I was searching for the main tags contained in tables. Of course, I would like to share them with you.
Table tags mainly contain table, caption, th, tr, td, thead, tfoot, tbody, col, and colgroup. The following describes each Tag:
<Table>
Table labels can define tables. Inside the <table> label, you can place the table title, table row, table column, table Unit, and other tables.
<Caption>
The caption element can define a table title. The caption label must follow the table label. You can define only one title for each table. This title is usually centered on the table.
<Th>
Defines the table header cells. The text inside this th element is usually in bold.
<Tr>
Define a row in the table.
<Td>
Defines a cell in the table.
<Thead>
Define the table header.
Thead, tfoot, and tbody elements allow you to group rows in a table. When creating a table, you may want to have a title row, some rows with data, and a total row at the bottom. This division enables the browser to support table body scrolling independent of the table title and footer. When a long table is printed, the table header and footer can be printed on each page that contains table data.
<Tbody>
Define a table body ).
The <tbody> label can be used to separate a table. <Tbody> A tag combines one or more rows in a table into one group.
Although you may want to include one or more <tbody> labels in the table, we recommend that you do not have the <tbody> label in the table.
In the <tbody> label, only the <tr> label can define table rows. Once defined, a <tbody> label is an independent part of the table. For example, you cannot <tbody> span from one <tbody> to another <tbody>.
Thead, tfoot, and tbody elements allow you to group rows in a table. When creating a table, you may want to have a title row, some rows with data, and a total row at the bottom. This division enables the browser to support table body scrolling independent of the table title and footer. When a long table is printed, the table header and footer can be printed on each page that contains table data.
<Tfoot>
Define the table footer (footer ).
Thead, tfoot, and tbody elements allow you to group rows in a table. When creating a table, you may want to have a title row, some rows with data, and a total row at the bottom. This division enables the browser to support table body scrolling independent of the table title and footer. When a long table is printed, the table header and footer can be printed on each page that contains table data.
<Col>
Defines the attribute values of one or more columns in a table. You can only use this attribute in tables or colgroups.
<Colgroup>
Defines the group of table columns. This element allows you to combine columns for formatting. This element is valid only within the <table> label.
There are two ways to use the <colgroup> label: one is to define several identical columns, and the other is to combine several different columns.
PS: The above content is from w3school, because w3school marks copyright in the copyright information and reserves all rights. In this case, you can click here to view the details of a tag. You can also view the table introduction.