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
21focused categories
5implementation paths
01Create Excel TableUse a trusted XLSX template when a native Excel table object, table style, totals row, or filtering behavior must be retained.
+
Use a trusted XLSX template when a native Excel table object, table style, totals row, or filtering behavior must be retained.
preserveAdvancedObjectsFrom()<?php
use Mnb\PHPExcel\MnbExcel;
MnbExcel::fromArray($rows)
->withHeader()
->preserveAdvancedObjectsFrom('templates/sales-table.xlsx')
->save('sales-table-output.xlsx');02Structured ReferencesKeep a named Excel table in a template and write formulas that use its structured references.
+
Keep a named Excel table in a template and write formulas that use its structured references.
MnbExcel::formula()preserveAdvancedObjectsFrom()<?php
use Mnb\PHPExcel\MnbExcel;
$summary = [[
'Metric' => 'Total sales',
'Value' => MnbExcel::formula('SUM(SalesTable[Amount])', 11600),
]];
MnbExcel::fromWorkbookArray([
'Data' => $rows,
'Summary' => $summary,
])
->withHeader()
->preserveAdvancedObjectsFrom('templates/structured-table.xlsx')
->save('structured-reference.xlsx');Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue