HTML table markup tutorial (14): table headers


In the HTML language, you can automatically add a title to a table by marking it. In addition, the first row of the table is called the header, which can also be achieved through HTML tags.
Basic grammar
<TABLE> ….


<th> Title 1</th><th> Title 2</th><th> Title 3</th><th> Title 4</th><th> Title 5</th>



Grammatical interpretation
Define the width of the border line in pixels through the border attribute.
<title> comprehensive examples of table tags </title>
<table border=”1″ width=”80%” bgcolor=”#e8e8e8″ cellpadding=”2″ bordercolor=”#0000ff” bordercolorlight=”7d7dff” bordercolordark=”#0000a0″>
<th width= “30%” colspan= “2” valign= “bottom” > Atlantic Division </th>
<th width= “30%” colspan= “2” valign= “bottom” > Central Division </th>
<th width= “30%” colspan= “2” valign= “bottom” > Southeast Division </th>
<td width= “16%” align= “center” > Celtic</td>
<td width= “16%” align= “center” >76 people</td>
<td width= “17%” align= “center” > piston</td>
<td width= “17%” align= “center” > bull</td>
<td width= “17%” align= “center” > heat</td>
<td width= “17%” align= “center” > Wizards</td>
<td width= “16%” align= “center” > net</td>
<td width= “16%” align= “center” > Knicks</td>
<td width= “17%” align= “center” > walkers</td>
<td width= “17%” align= “center” > Knight</td>
<td width= “17%” align= “center” > Magic</td>
<td width= “17%” align= “center” > SM</td>
<td width= “16%” align= “center” > Raptors</td>
<td width= “16%” align= “center” > crossing the river</td>
<td width= “17%” align= “center” > bucks</td>
<td width= “17%” align= “center” > zhijiage</td>
<td width= “17%” align= “center” > Eagle</td>
<td width= “17%” align= “center” > Yao Ming</td>

Where <th></th> refers to the header and title of the table.