MNB PHPExcelDeveloper Guide

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
Example 01

Create Excel Table

preserveAdvancedObjectsFrom()
create-excel-table.php
<?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');