Chad Chad - 1 month ago 13
HTML Question

Do invisible (display:none) cells count toward colspan

Just wondering. Also, is this applied equally across browsers?

e.g.:

<table><tr>
<td>asdf</td>
<td style="display:none;">asdf</td>
<td>asdf</td>
</tr></table>


does colspan == 2 or 3?

Answer

It is colspan=2

<table border=1>
    <tr>
        <td>asdf</td>
        <td style="display:none;">asdf</td>
        <td>asdf</td>
        <td>go</td>
    </tr>
    <tr>
        <td>asdf</td>
        <td>asdf</td>
        <td>asdf</td>
    </tr>
    <tr>
        <td colspan=2>asdf</td>
        <td>asdf</td>
    </tr>
</table>

You can see it with this example expanded