Table header misaligned // fnAdjustColumnSizing

Table header misaligned // fnAdjustColumnSizing

presagepresage Posts: 8Questions: 0Answers: 0
edited November 2012 in DataTables 1.9
Hi, my table header was misaligned with my datas since i added a scroller so i search on the forum how to solve this and fnAdjustColumnSizing works well.
I have a class css hide, without it, if i display my table at start, all works fine.
But i use a button to display my table and need fnAdjustColumnSizing.
My problem is, it works...but it's ugly because we have time to see the table resizing. How can i fix it?

My button: Rechercher
My css:
.hide
{
display: none;
}
My javascript(in document.ready):

var oMsgofTable = $('#table_msgof').dataTable({
"sScrollY": "150px",
"sAjaxSource": "/ajax/get-msgof-list/",
"bServerSide": true,
"sDom": "frtiS",
/*"oScroller": {
"loadingIndicator": true // facultatif
}*/
});

$('#but').live('click',function(){
oMsgofTable.fnAdjustColumnSizing(); //Corrige le probleme d'alignement du header

$("#msgof_form_outer").toggleClass("hide");
});

Thanks for your time :) //Hope you understand my english =p

Replies

  • presagepresage Posts: 8Questions: 0Answers: 0
    up
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited November 2012
    http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Please post a link to a test case in future.

    For this you could make the element `display:block` but `visibility:hidden` while the redraw is done before finally making it visible.
  • presagepresage Posts: 8Questions: 0Answers: 0
    It seems to be a good idea, i don't have time to try it today, i will in one week and say if it's ok.
    Thanks
This discussion has been closed.