Tables examples
Tables Excel examples, explained clearly.
Open a focused example to see the implementation path, copy-ready PHP, expected workbook behavior, and the production boundary that matters.
2examples in this category
21supported categories
5implementation paths
Monolithic library
Tables examples with copy-ready, production-minded PHP.
Each example identifies the exact methods it uses and can be opened independently from the right-side index.
- 2
- examples
- 2
- documented methods
preserveAdvancedObjectsFrom()<?php
declare(strict_types=1);
/*
Summary:
Use a trusted XLSX template when a native Excel table object, table style, totals row, or
filtering behavior must be retained.
Implementation note:
MNB PHPExcel preserves table package parts from a same-sheet-order template. From-scratch
table-object authoring is not exposed as a dedicated builder method.
*/
use Mnb\PHPExcel\MnbExcel;
MnbExcel::fromArray($rows)
->withHeader()
->preserveAdvancedObjectsFrom('templates/sales-table.xlsx')
->save('sales-table-output.xlsx');MnbExcel::formula()preserveAdvancedObjectsFrom()<?php
declare(strict_types=1);
/*
Summary:
Keep a named Excel table in a template and write formulas that use its structured references.
Implementation note:
The table name and columns must already exist in the trusted template and remain aligned with
the written data range.
*/
use Mnb\PHPExcel\MnbExcel;
$summary = [[
'Metric' => 'Total sales',
'Value' => MnbExcel::formula('SUM(SalesTable[Amount])', 11_600),
]];
MnbExcel::fromWorkbookArray([
'Data' => $rows,
'Summary' => $summary,
])
->withHeader()
->preserveAdvancedObjectsFrom('templates/structured-table.xlsx')
->save('structured-reference.xlsx');No matching example found.Try a method name, task, or result.
Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue