0

After validating my file, I received feedback telling me that my th element had no cells beginning in it. I'm not sure how to go about fixing this or what it means. Any tips?

<h2> Likes and Dislikes </h2>

<table class = "foodTable">
<caption>Food</caption>
<thead>
<tr>
    <th colspan = "2" style = "border-top:none;border-left:none;">&nbsp;</th>
    <th>Hate</th>
    <th>Dislike</th>
    <th>Indifferent</th>
    <th>Like</th>
    <th>Love</th>
</tr>
</thead>

<tbody>
    <tr>
        <th colspan = "2">Chocolate</th>
        <td> - </td>
        <td> - </td>
        <td> - </td>
        <td> - </td>
        <td>&#10004;</td>
    </tr>
    <tr>
        <th colspan = "2">Ketchup</th>
        <td> &#10004;</td>
        <td> - </td>
        <td> - </td>
        <td> - </td>
        <td> - </td>
        </tr>

    <tr>
        <th colspan = "2">Cheese</th>
        <td> - </td>
        <td> &#10004;</td>
        <td> - </td>
        <td> - </td>
        <td> - </td>
    </tr>
</tbody>

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Liz
  • 11
  • 1
  • There are a few odd things in your code. First, why are _all_ the first cells double-column? That only makes sense if _some_ of them are. Second, you really shouldn’t put spaces around the `=` in your attributes (use: `colspan="2"`). I’ve never seen the error you are reporting, but what happens if you remove the `colspan="2"` attributes altogether, since they’re not doing anything useful? Which validator are you using? – Manngo Mar 26 '17 at 10:24
  • @Manngo: Spaces around the = are unusual but not wrong. But the colspan is indeed the problem here. – BoltClock Mar 26 '17 at 10:40

0 Answers0