8

我正在使用数据表。( http://datatables.net/ ) 我创建了一个表。我正在努力改变一个身高问题。我用萤火虫检查了桌子的大小。表格高度默认设置为 302px。我找不到如何更改。我尝试更改 css 失败。我很感激,如果有人帮助。

来自萤火虫:

.dataTables_wrapper {
    clear: both;
    min-height: 302px;
    position: relative;
}

在此先感谢.. Ozlem

4

3 回答 3

19

px之后添加200

$('#id').css('min-height','200px');

希望它能为某人节省 10 秒。

于 2011-06-20T20:43:19.093 回答
6

// 您可以通过 .css 设置任何 css 属性,如下所示

$('#id').css('min-height','200');
于 2010-12-09T05:00:43.950 回答
0

现在我会在site.js中实现这样的https://datatables.net/reference/option/fixedColumns.heightMatch

$('.dataTables_wrapper').DataTable( {
fixedColumns: {
    heightMatch: 'none'
}});

在 site.css 中:

td {
line-height: 45px;}
于 2021-09-06T19:56:55.827 回答