Nitish Nitish - 8 months ago 29
Javascript Question

td colspan not working for tr with ids

I have a table structure similar to below:

<td colspan="5">
<tr id="abcd_<?php echo $id; ?>" style="display: none">
<td colspan="5">
<span id="hidtb_<?php echo $id; ?>"></span>

The table is within a loop and the value of
changes. The second
is set to
display : block
using javascript. But the
<td colspan="5">
is not covering all the five
s, instead only one .final output table. Why my
is not working ?


This is the problem with display: block.

Please refer the below link

If you are hiding tr, then use display: table-row instead of display: block to display that tr.

If you are hiding td, then use display: table-cell instead of display: block to display that td.

Use table-row, no block when styling a tr. Perfect!