PHP,Jquery,嵌套的html表


PHP, Jquery, nested html table

我正在尝试弄清楚如何在嵌套表中显示其他信息。基本的 html 数据表是通过 PHP 生成的。某些数据字段具有单选按钮。单击 rb 后,嵌套数据表应该在基本数据行下方可见,但对于每一行。

PHP代码:

while (oci_fetch($stmt)){
echo  "<tr>'n"
    . "<td class='v'>" . oci_result($stmt, 'COL1') . "</td>'n"
    . "<td class='v'>" . oci_result($stmt, 'COL2') . "</td>'n"
    . "<td class='v'>" . oci_result($stmt, 'COL3') . "</td>'n"
    . "<td class='v'>" . oci_result($stmt, 'COL4') . "</td>'n"
    . "<td class='v1'><input type='radio' name='info' value='SUB_INFO' id='rbt'>". oci_result($stmt, 'DETAILS') .  "</td>'n"
    . "</tr>'n";
}
echo "</table>'n";

感谢您分享您的想法!

你能用更多的代码更新你的原始帖子,包括上面的表格(即使它只是html)吗?我想我有一个解决方案给你,但我对你想做什么很模糊。

还有为什么不这样做呢?

<tr> 
<?php $cols = array('COL1','COL2','COL3','COL4'); 
     for ($i=0; $i < count($cols)-1; $i++) { ?>
        <td class='v'> <?php echo oci_result($stmt, $cols[$i] ) ?></td>
<?php } //end the for loop?>
        <td class='v1'>
            <input type='radio' name='info' value='SUB_INFO' id='rbt'><?php echo oci_result($stmt, 'DETAILS') ?></td>
</tr>
</table>