dist/jquery.floatThead.js
function columnNum(){
        var count;
        var $headerColumns = $header.find(opts.headerCellSelector);
        if(existingColGroup){
          count = $tableColGroup.find('col').length;
        } else {
          count = 0;
          $headerColumns.each(function () {
            count += parseInt(($(this).attr('colspan') || 1), 10);
          });
        }
        if(count !== lastColumnCount){
          lastColumnCount = count;
          var cells = [], cols = [], psuedo = [], content;
          for(var x = 0; x < count; x++){
            content = $headerColumns.eq(x).text();
            cells.push('<th class="floatThead-col" aria-label="'+content+'"/>');
            cols.push('<col/>');
            psuedo.push(
              $('<fthtd>').css({
                'display': 'table-cell',
                'height': 0,
                'width': 'auto'
              })
            );
          }

          cols = cols.join('');
          cells = cells.join('');

          if(createElements){
            $fthRow.empty();
            $fthRow.append(psuedo);
            $fthCells = $fthRow.find('fthtd');
          }

          $sizerRow.html(cells);
          $sizerCells = $sizerRow.find("th");
          if(!existingColGroup){
            $tableColGroup.html(cols);
          }
          $tableCells = $tableColGroup.find('col');
          $floatColGroup.html(cols);
          $headerCells = $floatColGroup.find("col");

        }
        return count;
      }
function columnNum(){
        var count;
        var $headerColumns = $header.find(opts.headerCellSelector);
        if(existingColGroup){
          count = $tableColGroup.find('col').length;
        } else {
          count = 0;
          $headerColumns.each(function () {
            count += parseInt(($(this).attr('colspan') || 1), 10);
          });
        }
        if(count !== lastColumnCount){
          lastColumnCount = count;
          var cells = [], cols = [], psuedo = [], content;
          for(var x = 0; x < count; x++){
            content = $headerColumns.eq(x).text();
            cells.push('<th class="floatThead-col" aria-label="'+content+'"/>');
            cols.push('<col/>');
            psuedo.push(
              $('<fthtd>').css({
                'display': 'table-cell',
                'height': 0,
                'width': 'auto'
              })
            );
          }

          cols = cols.join('');
          cells = cells.join('');

          if(createElements){
            $fthRow.empty();
            $fthRow.append(psuedo);
            $fthCells = $fthRow.find('fthtd');
          }

          $sizerRow.html(cells);
          $sizerCells = $sizerRow.find("th");
          if(!existingColGroup){
            $tableColGroup.html(cols);
          }
          $tableCells = $tableColGroup.find('col');
          $floatColGroup.html(cols);
          $headerCells = $floatColGroup.find("col");

        }
        return count;
      }
function columnNum ( ) { var count ; var $headerColumns = $header . find ( opts . headerCellSelector ) ; if ( existingColGroup ) { count = $tableColGroup . find ( 'col' ) . length ; } else { count = 0 ; $headerColumns . each ( function ( ) { count += parseInt ( ( $ ( this ) . attr ( 'colspan' ) || 1 ) , 10 ) ; } ) ; } if ( count !== lastColumnCount ) { lastColumnCount = count ; var cells = [ ] , cols = [ ] , psuedo = [ ] , content ; for ( var x = 0 ; x < count ; x ++ ) { content = $headerColumns . eq ( x ) . text ( ) ; cells . push ( '<th class="floatThead-col" aria-label="' + content + '"/>' ) ; cols . push ( '<col/>' ) ; psuedo . push ( $ ( '<fthtd>' ) . css ( { 'display' : 'table-cell' , 'height' : 0 , 'width' : 'auto' } ) ) ; } cols = cols . join ( '' ) ; cells = cells . join ( '' ) ; if ( createElements ) { $fthRow . empty ( ) ; $fthRow . append ( psuedo ) ; $fthCells = $fthRow . find ( 'fthtd' ) ; } $sizerRow . html ( cells ) ; $sizerCells = $sizerRow . find ( "th" ) ; if ( ! existingColGroup ) { $tableColGroup . html ( cols ) ; } $tableCells = $tableColGroup . find ( 'col' ) ; $floatColGroup . html ( cols ) ; $headerCells = $floatColGroup . find ( "col" ) ; } return count ; }
get the number of columns and also rebuild resizer rows if the count is different than the last count
get the number of columns and also rebuild resizer rows if the count is different than the last count