ExcelAnt\Adapter\PhpExcel\Sheet\Sheet::addTable PHP Метод

addTable() публичный Метод

public addTable ( ExcelAnt\Table\TableInterface $table, ExcelAnt\Coordinate\Coordinate $coordinate )
$table ExcelAnt\Table\TableInterface
$coordinate ExcelAnt\Coordinate\Coordinate
    public function addTable(TableInterface $table, Coordinate $coordinate)
    {
        $table->setCoordinate($coordinate);
        $this->tables[] = $table;
        return $this;
    }

Usage Example

Пример #1
0
 /** {@inheritdoc} */
 public function create($path, array $firstRow, $sheetName = '')
 {
     $workbook = new Workbook();
     $sheet = new Sheet($workbook);
     $table = new Table();
     $table->setRow($firstRow);
     $sheet->addTable($table, new Coordinate(1, 1));
     $workbook->addSheet($sheet);
     $writerFactory = new WriterFactory();
     $writer = $writerFactory->createWriter(new Excel5($path));
     $phpExcel = $writer->convert($workbook);
     $writer->write($phpExcel);
 }