Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using Datatables grid in one of my application because it has a relatively exhaustive API for event dispatching and customization . But I am facing a problem now , the grid's height depends on the number of records to be displayed . How can I customize it so that it maintains the height even if records are deleted and continue to show empty cells from where the record was deleted ? Thanks .

Is there any better grid plugin than datatables which provides the features supported by datatables and where I would not face such problem .

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

You can add this into your table initialisation like so:

$(document).ready(function() {
    $('#example').dataTable( {
        "sScrollY": "200px",
        "bPaginate": false, 
        "bScrollCollapse": false
    } );
} );

Where the sScrollY value will define the constant height of the table and bScrollCollapse set false will prevent the table from shrinking to fill empty cells.

share|improve this answer
add comment

You need to modify the CSS in order to achieve that. Other option is jqGrid. http://www.trirand.com/blog/jqgrid/jqgrid.html

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.