我有一个使用PHP创建的表格,当您单击要显示描述的项目名称时。在动态表格中隐藏描述
<table border="1" bordercolor="#000000">
<tr class="trintial">
<th width="50px"><input type="checkbox" readonly="readonly" checked="checked" /></th>
<th width="300px">To-Do Item</th>
<th width="100px">Priority</th>
<th width="100px">Due Date</th>
</tr>
<?php
$i=0;
while ($i < $num)
{
$entrynum=mysql_result($result,$i,'todo.entry');
$f2=mysql_result($result,$i,'todo.item');
$f3=mysql_result($result,$i,'todo.priority');
$f4=mysql_result($result,$i,'todo.duedate');
$f5=mysql_result($result,$i,'todo.description');
?>
<tr id="<?php echo "row$entrynum"; ?>" class="trintial">
<td><input type="checkbox" onchange="change(this,<?php echo "row$entrynum"; ?>)" name="<?php echo "box$entrynum"; ?>" value="checked" /></td>
<td><?php echo $f2; ?></td>
<td><?php echo $f3; ?></td>
<td><?php echo $f4; ?></td>
</tr>
<?php
$i++;
}
mysql_close($con);
?>
</table>
需要更多描述。你甚至没有输出任何地方的$ f5(我假设是你的描述)。你想如何展示?地点和原因?你应该看看jQuery - 它有许多功能致力于简单的UI显示/隐藏效果,并且是跨浏览器兼容的。 – 2010-08-28 23:06:35
当$ f2的文本被点击时,我需要它输出 – supertech 2010-08-28 23:10:20
'bordercolor'属性很久以前就被弃用了。改为使用等效的[CSS属性](http://www.w3.org/TR/CSS2/box.html#border-color-properties)。 – 2010-08-28 23:32:21