在jquery中是否有任何方法可以从其标题中设置第一行表格的上边距,
喜欢,
------------------
Header of table
------------------
--some margin--
------------------
Here comes the 1st row
------------------
我试过了,
$('#table-id .row-class').css('margin-top', 20);
它不起作用,而如果我使用它,
$('#table-id').css('margin-top', 20);
它将整个桌子向下移动,
答案 0 :(得分:2)
答案 1 :(得分:1)
试试这个:
$('#table-id .row-class').css('padding-top', '20px');
答案 2 :(得分:0)
您无法更改表格单元格的边距。但是你可以改变填充。更改TD的填充:
$('#table-id .row-class').css('padding-top', 20+'px');