Skip to content

Add ConvertToRange() method to remove ExcelTable while preserving formatting #2039

@egiorgioPatagonian

Description

@egiorgioPatagonian

In Microsoft Excel, the "Convert to Range" action on a table removes the ListObject structure but preserves all visual formatting (cell fill colors, font styling, borders, etc.).
Image

Currently, in EPPlus, calling:
worksheet.Tables.Delete(table);
Suggested Feature:
Introduce a method on ExcelTable like:
void ConvertToRange(bool preserveFormatting = true);
This method should:
Flatten the table structure (remove ExcelTable).
If preserveFormatting is true (default), apply the table’s style to the underlying cell range, including:
Fill/background color
Font styles (bold, italic)
Borders
Number formats
Column widths (optional)

Benefits:
Mimics Excel behavior users expect.
Makes EPPlus more suitable for template-based document generation.
Avoids ugly workaround code with manual style copying.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions