列上的PHP循环

列上的PHP循环,php,loops,html-table,phpexcel,Php,Loops,Html Table,Phpexcel,我正在使用PHPExcel将Excel文件转换为HTML表格 因为我添加了这个Jquery函数来修复我的第一行(因为Phpexcel不生成标记: 我正在使用插件Jquery var table = $('#sheet0'); // select the table of interest var thead = $('<thead/>').prependTo(table); // create <thead></thead>

我正在使用PHPExcel将Excel文件转换为HTML表格

因为我添加了这个Jquery函数来修复我的第一行(因为Phpexcel不生成
标记:

我正在使用插件Jquery

    var table = $('#sheet0'); // select the table of interest
         var thead = $('<thead/>').prependTo(table); // create <thead></thead>
        table.find('tbody tr').eq(0).appendTo(thead);
       // Now the table is ready to have your chosen method applied to fix the position of the thead.
      $('table#sheet0').floatThead({
          position: 'fixed',
          index: '8',
          overflow: 'auto'
  });
var table=$('#sheet0');//选择感兴趣的表
var thead=$('').prependTo(表);//创建
表.find('tbody tr').eq(0).附录(thead);
//现在,该表已经准备好应用您选择的方法来固定thead的位置。
$('table#sheet0')。floatThead({
位置:'固定',
索引:‘8’,
溢出:“自动”
});
我只想加载前13列,我制作了一个ReadFilter,但它不能正常工作

在这里,您可以看到在单元格中循环的代码:


如何在第13列停止循环?

您必须修改Writer代码以限制它,该功能未内置在PHPExcel中;除非您使用读取筛选器阻止它读取这些额外列,以仅显示Writer/HTML.php中的13列:

public function generateSheetData() {

            // CODE HERE

            // Get worksheet dimension
            $dimension = explode(':', $sheet->calculateWorksheetDimension());
            $dimension[0] = PHPExcel_Cell::coordinateFromString($dimension[0]);
            $dimension[0][0] = PHPExcel_Cell::columnIndexFromString($dimension[0][0]) - 1;
            $dimension[1] = PHPExcel_Cell::coordinateFromString($dimension[1]);
            ** HERE **
            $dimension[1][0] = 13;
它工作得很好,不是空白单元格

由于我在帖子中使用了如上所述的“floatThead plugin”,空白单元格仅出现在:

HTML输出:

我怎样才能访问这个th.floatThead来移除他

类似Jquery的东西

table.find('thead th.floatThead-col:nth-child(8)').remove();
无法访问th.floatThead-col以将其删除