title: Why Datatable header and footer not get displayed properly initially?
body: <p>I have configured datatable as below:</p>
  
  <pre><code>function BindDataTable(targetGrid) {
          var sortableGrid = $(targetGrid).attr('id');
          var DT = $('#' + sortableGrid).dataTable({
              "fnInitComplete": function () {
                  $('#' + sortableGrid + ' thead &gt; tr').removeClass().addClass("HeaderGridView2").css('cursor', 'pointer');
                  $('#' + sortableGrid + ' tfoot &gt; tr').removeClass().addClass("FooterGridView2");
              },
              "bPaginate": false,
              "bLengthChange": false,
              "bFilter": false,
              "bSort": true,
              scrollY: '500px',
              "bInfo": false,
              "bScrollCollapse": true,
              "bAutoWidth": false,
              "asStripClasses": null, //To remove "odd"/"event" zebra classes
              "fnDrawCallback": function () {
                  $('#' + sortableGrid + ' tr').removeClass();
                  $('#' + sortableGrid + ' tr:even').addClass("RowGridView2 even");
                  $('#' + sortableGrid + ' tr:odd').addClass("AlternatingRowGridView2 odd");
                  $('#' + sortableGrid + ' thead &gt; tr').removeClass().addClass("HeaderGridView2").css('cursor', 'pointer');
                  $('#' + sortableGrid + ' tfoot &gt; tr').removeClass().addClass("FooterGridView2");
              }
          });
  
      }
  </code></pre>
  
  <p>But when the datatable gets binded and displayed first time it does not gets display properly as header and footer not set as per column width. After click on any column to sort table it gets displayed as expected with property header and footer as in below screen. Why does this happens?</p>
  
  <p><a href="https://i.stack.imgur.com/xrrIl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xrrIl.png" alt="enter image description here"></a></p>