Setting the datatable min height

Setting the datatable min height

andreacobaandreacoba Posts: 6Questions: 0Answers: 0
edited January 2012 in General
Hi, I'm wondering how to properly set the height of a jquery datatable without messing up its rows height. I tried setting sScrollY and it doesn't do anything. I tried setting the min-height property and two issues occur: the rows become very large (height) and the datatable height doesn't change... I also tried just setting the height property using CSS and the same issue as with min-height occurred.

Any ideas?

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    I don't quite understand I'm afraid - the min-height of the table itself? I don't think that is how HTML tables work...

    What you can do is set the min-height on the wrapper element, which will cause the control as a whole to take up that minimum height (.dataTable_wrapper is the call you want).

    Allan
  • andreacobaandreacoba Posts: 6Questions: 0Answers: 0
    thanks so much for answering! I did this and it worked:
    $('.dataTables_scrollBody').css('height', '200px');
  • shammipatneshammipatne Posts: 1Questions: 0Answers: 0
    I Tried to do the same thing $('.dataTables_scrollBody').css('height', '200px');
    But when i change the lenght of number of rows it again took previous height
    Please Help !!!.
This discussion has been closed.