The <TH> tag is used to set the properties of a header in the table. See the table below:
The <th> tag attribute of the table header
| Attributes | describe |
| ALIGN | Horizontal alignment |
| VALIGN | Vertical alignment of cell contents |
| BGCOLOR | Background color of cells |
| BACKGROUND | Background image of cells |
| BORDERCOLOR | Cell border color |
| BORDERCOLORLIGHT | Bright border color of cell |
| BORDERCOLORDARK | Dark border color of cell |
| WIDTH | Cell width |
| HEIGHT | The height of the cell |
Through the BGCOLOR attribute, the background color of the table header can be set.
Basic Syntax><TH BGcolor=color_VALUE>
Syntax explanationWhen defining colors, you can use English color names or hexadecimal color values to express them.
File example: 10-34.htmSet the color of the header background.
01 <!-- ------------------------------ -->
02 <!-- File example: 10-34.htm -->
03 <!-- File description: Set the color of the table header background-->
04 <!-- ------------------------------ -->
05 <HTML>
06 <HEAD>
07 <TITLE>Set the color of the table header background</TITLE>
08 </HEAD>
09 <BODY>
10 <H1>Mainstream web design software</H1>
11 <TABLE BORDER=3 WIDTH=400 HEIGHT=100 Bordercolor=#336699>
12 <TR>
13 <TH Bgcolor=#00FFFF>Web Image Software</TH><TH>Fireworks</TH>
14 </TR>
15 <TR>
16 <TD>Web page production software</TD><TD>Dreamweaver</TD>
17 </TR>
18 <TR>
19 <TD>Web animation software</TD><TD>Flash</TD>
20 </TR>
21 </TABLE>
22 </BODY>
23 </HTML>
Document descriptionLine 13 defines the background color of the table header to the color of #00FFFF.