jQuery   发布时间:2022-04-19  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了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>

当我点击“更多”时,将显示第1行描述.它表现得很好但是colspan不起作用.

这是我的js代码

personalChecking = function () {
        $('a.personal-checking-more-link').click(function() {
            $(this).parent().parent().next().toggle('slow');
        });

    }
$(document).ready(personalChecking);

提前致谢

解决方法

这是’display:block’的问题

请参考以下链接
http://thedesignspace.net/MT2archives/000376.html#.UUrg3FfCd1u

如果你隐藏tr,那么使用’display:table-row’而不是’display:block’来显示tr,

如果你隐藏了td,那么使用’display:table-cell’而不是’display:block’来显示td

大佬总结

以上是大佬教程为你收集整理的td colspan在使用jquery show / hide()时不起作用全部内容,希望文章能够帮你解决td colspan在使用jquery show / hide()时不起作用所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: