我有一個使用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