The tag thead


#1

Hello all!

I'm practice the html (thead with colspan) and belive that we have a error.

The atribute colpsan is for td and tr, correct ?

So

<!DOCTYPE html>
<html>
<head>
<style>
thead {color:green;}
tbody {color:blue;}
tfoot {color:red;}

table, th, td {
    border: 1px solid black;
}
</style>
</head>

<body>

<table>
  <thead colspan="4"> <-- this not work
    <tr>
      <th colspan="4">Month</th> this work
      <th>Savings</th>
    </tr>
  </thead>
  <tfoot>
    <tr>
      <td>Sum</td>
      <td>$180</td>
    </tr>
  </tfoot>
  <tbody>
    <tr>
      <td>January</td>
      <td>$100</td>
    </tr>
    <tr>
      <td>February</td>
      <td>$80</td>
    </tr>
  </tbody>
</table>

<p><b>Tip:</b> The thead, tbody, and tfoot elements will not affect the layout of the table by default. However, you can use CSS to style these elements.</p>

</body>
</html>

doc w3c


#2

no, colspan is for <th></th> and table cell (<td></td>), how many rows it should span, not for <thead></thead>, would be weird, the table head contains all the cells, so the span is already full


#3

So the content in the chapter (6. Clickable Photo Page) tell that we have use colspan on thead...
Please, update that for another users...

True, colspan is for td and th (w3c tell it too)

            <thead>
                <tr>
                    <th colspan="3">Photobucket</th>
                </tr>
            </thead>

thank you


#4

But this are recap exercise of html basic 3, if you post till the letter what has to happen, you take away a crucial part in learning the process of programming