0

I'm trying to change tr height of my jquery datatable, I'm looking for a property to set in the .DataTable, but unfortunately I doesn't find nothing.

So I though to set the height of tr like this:

$('#datatable')
        .css('min-height', '650px')
        .css('tr height', '20px')
        .DataTable

unfortunately the tr height isn't changed. What am I doing wrong?

Nikita R.
  • 7,245
  • 3
  • 51
  • 62
user3287550
  • 363
  • 4
  • 12

1 Answers1

1

if you are looking to just change the height of tr in table hen you should use this

$('#tableID tr').css('height', '200px')

or if you want to just increase the height of the tbody element then you can do this by

$('#tableID tbody tr').css('height', '20px')

Only header :

$('#tableID thead tr').css('height', '20px')
Nalin Aggarwal
  • 886
  • 5
  • 8
  • This is the correct answer ! Don't get lost with _.children()_ etc https://jsfiddle.net/c02b4hxv/2/ for the sake of example – Gregoire Aug 19 '16 at 15:47
  • @GrégoireFruleux is possible set also the min height of a table? 'cause I actually seems cannot have both set: `$("#datatable").css("min-height", "650px");` How can I do that? – user3287550 Aug 19 '16 at 16:06
  • @user3287550 I guess it is useless, check this [StackOverflow](http://stackoverflow.com/a/11275916/6341631) , it says that _min-height_ and _height_ are the same for tables ... – Gregoire Aug 19 '16 at 16:10