TR TD th usage in HTML tables

Source: Internet
Author: User

Tables are often used in HTML, simple use may be a lot of people are not a problem, but more in-depth understanding of the people are not many, let us first look at how to use.

<table> is the top label for <tr>
<tr> must be in a <table></table>, it cannot be used alone, equivalent to the <table> attribute tag.
<table> mark a table,<tr> mark a row in the middle of the table
<td> identifies a column in the row that needs to be nested in the <tr></tr> center

The specific format is: (two rows and two columns)
<table>
<tr>
<td></td>
<td></td>
</tr>
</teble>

<th>, like <td>, is also nested in the <tr>,<tr> in <table>

<table>...</table> to define a table start and end

<th>...</th> defines the header cells. The text in the table will be shown in bold (<TH> and <TD> are also marked with a cell, the only difference being that the text in the indicated cell is shown in bold, so you can see:
<th> text </th>=<td><b> text </b></td>
),
You can also use this label in the table,<th> label must be placed in the <tr> tag

<tr>...</tr> defines a row of labels that can be set up in groups of cells defined by <td> or <th> tags within a set of row labels

<td>...</td> Define cell labels, a set of <td> tags will create a cell,<td> label must be placed in the <tr> tag


。 <th> for the table title, the attribute Summar is the summary,<caption> label the first part of the Description,<thead> label for the table header,<tbody> label as the table body content,<tfoot> The label is the tail of the table.
You can also use scope to override the headers property to mark cells containing header information, where the contents of each value are as follows:
Row indicates the current cell, providing related header information for the row that contains the current cell.
Col indicates the current cell, providing the appropriate header information for the column specified by the current cell.
Rowgroup indicates the current cell, providing related header information for the remaining row groups that contain the current cell.
Colgroup indicates the current cell, providing the appropriate header information for the remaining column groups specified by the current cell.
The abbr is used to define the abbreviated name in the header cell, and if the property is not defined, the default cell content is abridged.
Standard tabular Model
<table>
<caption></caption>
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
</tr>
</tbody>
<tfoot>
<tr>
<td></td>
</tr>
</tfoot>
</table>

Related:

<th> is not only bold, but also centered.
<caption> is also centered, and caption is not in border if the table has border.
Valid tags contained within the TFOOT element are:
Td
TH
Tr
Any given Table object can only define one TFoot

TR TD th usage in HTML tables

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.