column display issue while calling table.style.display="block"; .

column display issue while calling table.style.display="block"; .

shmsrpcshmsrpc Posts: 4Questions: 0Answers: 0
edited July 2013 in DataTables 1.9
here is my code
I have a datable which I want to hide initially. When a users clicks a button, the datatable appears. That results in the column everything showing correctly except the thead,tfoot display .thead,tfoot display is having problem ,width of thead,tfoot is not correct.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">




$(document).ready(function() {
var oTable = $('#example').dataTable( {
"sScrollY": "200px",
"bPaginate": false
} );
$(window).bind('resize', function () {
oTable.fnAdjustColumnSizing();
} ); document.getElementById("example").style.display="block";

} );

DataTables live example

@import "/media/css/demo_page.css";
@import "/media/css/demo_table.css";






Live example




Rendering engine
Browser
Platform(s)
Engine version
CSS grade




Trident
Internet Explorer 4.0
Win 95+
4
X


Trident
Internet Explorer 5.0
Win 95+
5
C

Replies

  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    A table isn't a block element. Its a table display element :-). You want `document.getElementById("example").style.display="table";` .

    Allan
This discussion has been closed.