1

グリッド線が表示されません。以下は私のコードです。助けてください。

 <?php
 require_once '../Classes/PHPExcel.php';
 $inputFileName = 'current.xlsx'; 
 $inputFileType = PHPExcel_IOFactory::identify($inputFileName); 
 $objReader = PHPExcel_IOFactory::createReader($inputFileType);
 $objPHPExcel = $objReader->load($inputFileName);
 $objWorksheet = $objPHPExcel->getActiveSheet();
 $objPHPExcel->getActiveSheet()->setShowGridlines(true);

 $highestRow = $objWorksheet->getHighestRow(); 
 $highestColumn = $objWorksheet->getHighestColumn(); 
 $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); 

 echo '<div id="xl">' . "\n";
 echo '<table>' . "\n";
 for ($row = 1; $row <= 2; ++$row) {
 echo '<tr>' . "\n";

 for ($col = 0; $col <= $highestColumnIndex; ++$col) {
 echo '<td>' . $objWorksheet->getCellByColumnAndRow($col, $row)->getValue() . '</td>' .      "\n";
  }

 echo '</tr>' . "\n";
 }
 echo '</table>' . "\n";
echo '</div>' . "\n";
?>
4

1 に答える 1

0

そのように表示されました。以下は私のコードです。

$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');
$objWriter->save('php://output');
于 2013-11-03T04:35:42.393 に答える