You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] - Support Tables and Table Styles during Export #975
Excel Tables aka SpreadsheetML Tables are a very powerful feature that are easily enabled just by adding them to the tables XML. MiniExcel already supports reading from tables, it should also support writing to tables. The default export mode should use a table rather than table-like stylings.
Document Formats
What document formats will benefit from this new functionality?
XLSX
CSV
XLSM
Other
Motivation
Utilize Tables in Excel Spreadsheets for easier pivot table, access via tools such as PowerBI, etc.
Proposed Solution
ExportAsync (and similar) take a TableName parameter (default Table1 if not specified), and update the TableStyle enum to include all the table styles (e.g. Medium2). Default Style should be TableStyleMedium2 which most closely matches the existing format. This could also be done in the OpenXMLConfiguration.
If exporting to an existing sheet and tablename is specifid, export to that table, erroring if the data format does not fit the existing column format.
Alternatives Considered
Currently opening and adding the table via ClosedXML as a workaround after export.
This is an interesting proposition, I do believe it would be a good change and it shouldn't be too complicated to implement for new documents, but I'm a little worried about the implementation for inserting data into existing document, it could get messy very easily. Similar concerns are due for multi-sheet exports. We'll have to do some viability analysis about this.
So, after some evaluation I've encountered a significant roadblock, which is the fact that MiniExcel allows for exporting properties to arbitrary non-adjacent columns through the MiniExcelColumnIndex attribute. This behaviour is incompatible with assigning the whole spreadsheet range to a table, as a table cannot contain discontinuities by definition. This would be a major breaking change if it were to be set as the default export mode. We could try to add it as a secondary export mode instead, but it'll require some more investigation.
Requiring cells to be empty before applying a table style to avoid the complications around inserting data
Making it a configuration behavior rather than the default, as a library consumer (in my case the ExcelFast PowerShell module) can choose to make it default.
Having the configuration behavior be gated or throw an exception on non-continguous ranges.
Activity
michelebastione commentedon Jun 26, 2026
This is an interesting proposition, I do believe it would be a good change and it shouldn't be too complicated to implement for new documents, but I'm a little worried about the implementation for inserting data into existing document, it could get messy very easily. Similar concerns are due for multi-sheet exports. We'll have to do some viability analysis about this.
michelebastione commentedon Jun 28, 2026
So, after some evaluation I've encountered a significant roadblock, which is the fact that MiniExcel allows for exporting properties to arbitrary non-adjacent columns through the
MiniExcelColumnIndexattribute. This behaviour is incompatible with assigning the whole spreadsheet range to a table, as a table cannot contain discontinuities by definition. This would be a major breaking change if it were to be set as the default export mode. We could try to add it as a secondary export mode instead, but it'll require some more investigation.JustinGrote commentedon Jun 28, 2026
I'd be perfectly fine with: