} else { td.style.background = ''; } } var data = <?php echo json_encode($csv->unparse($csv->data, $csv->titles, null, null, null, true)); ?> ; var container = $("#example1"); var hand = container.handsontable({ data: data, startRows: data.length, //<?php echo $csv->filelines('../out/test.csv'); ?> , startCols: <?php echo count($csv->titles); ?> , rowHeaders: true, //turn on 1, 2, 3, ... colHeaders: <?php echo json_encode($csv->titles); ?> , minSpareRows: 1, minSpareCols: 1, contextMenu: true, /*onChange: function (change, source) {