-3

I know that the browsers are very flexible with html, but is there any other reason why this is possible?

<table>
    <tr>
        <th>
            Column 1
        </th>
    </tr>
<table>
Tiago Almeida
  • 137
  • 1
  • 1
  • 9

2 Answers2

4

<th> doesn't necessarly mean it's in the head of the table. For example, you might have this layout:

<table>
  <tr>
    <th>Name:</th>
    <td>Tarquin Smith</td>
  </tr>
  <tr>
    <th>Occupation:</th>
    <td>Jovian Agent</td>
  </tr>
</table>
Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
2

<thead> contains rows. long story short it just says that that row is the head row. i dont use it but it just makes it easier to use it in your css. for example:

<table>
  <thead>
    <tr>
      <th>Month</th>
      <th>Savings</th>
    </tr>
  </thead>

and your css could say: thead {color:green;}

<th> is for one cell in your table and all it does is bold and center the text in it.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Musti Hakan
  • 47
  • 1
  • 12