<th.>-------------> table heading
<thead.>-------->table heading
What’s the difference?
<th.>-------------> table heading
<thead.>-------->table heading
What’s the difference?
A lot, actually. There is only one THEAD and multiple TH, for starters.
<table>
<caption>THEAD vs TH</caption>
<thead>
<tr><th colspan="3">TRUTH TABLE</th></tr>
</thead>
<tbody>
<tr>
<td>AND</td>
<th scope="col">true</th>
<th scope="col">false</th>
</tr>
<tr>
<th scope="row">true</th>
<td>true</td>
<td>false</td>
</tr>
<tr>
<th scope="row">false</th>
<td>false</td>
<td>false</td>
</tr>
</tbody>
</table>
When styled with this CSS,
table {
border-collapse: separate;
border: 1px solid black;
width: 12em;
margin: 1em auto;
}
th, td {
padding: 5px;
border: 1px solid red;
}
td {
text-align: center;
}
gives the following result…
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.