更改表格行高 [英] Changing table row height
本文介绍了更改表格行高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将属于特定类的表的行高更改为0.
目前我这样做:
$(#table_rolecart tbody)。append('< tr class ='hide'>< td>开始日期:<输入类型=textvalue =id =ar_startdate>< / td>< td>结束日期:< input type =textvalue =id =ar_enddate>< / td> ;< / TR>');
$('。hide')。height =0
它仍然不为零,如何为这些< tr>
s设置高度为0或将显示样式设置为无?
解决方案
使用 css
功能:
$('。hide')。css('height','0');
如果你想将它们从视线中删除,你也可以设置显示:无
:
$('。hide')。css('display','none' );
您也可以完全删除它们:
<$ ( '隐藏')。p $ p>
$除去();
但是,如果你不需要动态隐藏它们,你应该只使用CSS:
.hide {
height:0;
/ *或显示:无* /
}
I am trying to change the row height of a table belonging to a particular class to 0.
Currently I am doing this:
$("#table_rolecart tbody").append('<tr class='hide'><td>Start Date: <input type="text" value="" id="ar_startdate"></td><td>End Date: <input type="text" value="" id="ar_enddate"></td></tr>');
$('.hide').height = "0"
It's still not zero, how do I set the height to 0 or set display style to none for those <tr>
s?
解决方案
Use the css
function:
$('.hide').css('height', '0');
If you want to remove them from sight, you can also set display: none
:
$('.hide').css('display', 'none');
You can also remove them entirely:
$('.hide').remove();
If you don't need to hide them dynamically, however, you should just be using CSS:
.hide {
height: 0;
/* or display: none */
}
这篇关于更改表格行高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文