td colspan在使用jquery show/hide()时不起作用 [英] td colspan does not work while using jquery show/hide()
本文介绍了td colspan在使用jquery show/hide()时不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个目录
<table>
<thead>
<tr>
<th>First Name </th>
<th>Last Name </th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>John</td>
<td>Deo</td>
<td><a class="personal-checking-more-link">More</a></td>
</tr>
<tr><td style="display:none" colspan="3">Description goes for 1st row</td></tr>
<tr class="odd">
<td>Jaden</td>
<td>Aidan</td>
<td><a class="personal-checking-more-link">More</a></td>
</tr>
<tr><td style="display:none" colspan="3">Description goes for 2nd row</td></tr>
</tbody>
当我点击更多时,第一行说明将显示.它完美显示,但colspan不起作用.
When I click on More then 1st row Description will shown. it shows perfactly but colspan does not work.
这是我的js代码
personalChecking = function () {
$('a.personal-checking-more-link').click(function() {
$(this).parent().parent().next().toggle('slow');
});
}
$(document).ready(personalChecking);
预先感谢
推荐答案
这是'display:block'的问题
This is the problem with 'display:block'
请参考以下链接 http://thedesignspace.net/MT2archives/000376.html#.UUrg3FfCd1u
如果要隐藏tr,请使用"display:table-row"而不是"display:block"显示该tr,
If you are hiding tr, then use 'display:table-row' instead of 'display:block' to display that tr,
如果您隐藏了td,请使用"display:table-cell"而不是"display:block"显示该td
If you are hiding td, then use 'display:table-cell' instead of 'display:block' to display that td
这篇关于td colspan在使用jquery show/hide()时不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文