开发者

jquery datatables change default min-height

I am using datatables. ( http://datatables.net/ ) I have created a table. There 开发者_Go百科is a height problem I am struggling to change. I checked the table size with firebug. The table height is set 302px by default. I could not find how to change.I tried to change css unsuccessfully. I appreciate, if anyone helps.

from firebug:

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

Thanks in advance.. Ozlem


Add px after 200.

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

Hope it saves somebody 10 seconds.


// you can set the any css property through .css like below

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


Nowadays I would implement sth like this https://datatables.net/reference/option/fixedColumns.heightMatch, in site.js:

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

and in site.css:

td {
line-height: 45px;}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜