开发者

Toggling table row changes width of columns in other rows

I have a table like the following:

<table width="100%">
<tr class="clickme">
    <td width="1%">A</td>
    <td>B</td>
    <td width="50px">C</td>
    <td width="50px">D</td>
</tr>

<tr class="contain">
    <td colspan="4">Lorem Ipsum</td>
</tr>
</table>

And the following js

$(function(){
    $('.clickme').click(function(){
        $(this).next('tr').toggle();
     });
});

For Opera this is fine, however, in IE and Firefox, when I toggle the .contain table row, all of the .clickme table r开发者_运维知识库ow's columns' width changes, anyone has any idea why?


Try this function:

$(this).siblings().toggle();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜