Paulj Paulj - 2 months ago 9
HTML Question

html table syntax validation

This should be an easy one.

I have a table like so:

<table>
<tr>
<td></td><td></td><td></td><td></td>
</tr>
<tr>
<td></td>
</tr>
</table>


My firefox 3 validator says this is acceptable code. It just seems wrong to me, are there any possible issues leaving the table rows uneven like this? It works in IE7 too.

Answer

You should use 'rowspan' or 'colspan' attributes

<table>
  <tr>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td colspan="3"></td>
  </tr>
</table>
Comments