Is it possible to fix the table height?

Is it possible to fix the table height?

billfbillf Posts: 3Questions: 0Answers: 0
edited April 2009 in General
I think this is really a css question but I'm guessing members of this forum understand all things tabular so hear goes.

I know I can set the rows per page but I would like the table to stay the same size if actual rows < rows per page. Setting table {height: Xpx;} in css just causes the row height to expand to fill the table height.

Is a solution possible by a) css or b) some DataTables config to pad out empty rows?

Cheers,
Bill

Replies

  • allanallan Posts: 63,236Questions: 1Answers: 10,417 Site admin
    edited April 2009
    Hi Bill,

    Yes this is certainly possible. What to do is put a "div" element around your table using the sDom parameter

    Example of sDom: http://datatables.net/examples/example_dom.html
    Documentation: http://datatables.net/usage#sDom

    With a div around the table element, you can give that the height that you want.

    Allan
  • RobRob Posts: 17Questions: 0Answers: 0
    edited April 2009
    I think the URL for the sDom example you're referring to is:
    http://datatables.net/1.5-beta/examples/basic_init/dom.html

    It looks like you used your local path. Feel free to delete this message if you edit the original.

    Thanks, Rob
  • allanallan Posts: 63,236Questions: 1Answers: 10,417 Site admin
    Oops - thanks from pointing that out Rob! I've updated my post to use the standard sDom example. Leaving yours to point to the 1.5 version (there is no difference other than the core library version they use) :-)

    Allan
This discussion has been closed.