> ## Documentation Index
> Fetch the complete documentation index at: https://jetxl.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Excel tables

> Turn a range into a native Excel table with filters and banding

An Excel table is more than styling. It gives the range a name, adds filter dropdowns, bands the rows, and lets formulas refer to columns by name instead of by letter.

```python theme={null}
jet.write_sheet_arrow(
    df.to_arrow(),
    "table.xlsx",
    tables=[{
        "name": "SalesData",
        "start_row": 1,
        "start_col": 0,
        "style": "TableStyleMedium9",
    }],
)
```

## Sizing

Omitting `end_row` or `end_col`, or passing `0`, lets Jetxl work the bound out from the DataFrame. A negative number does the same thing.

<AccordionGroup>
  <Accordion title="end_row omitted" icon="arrows-up-down">
    Becomes `start_row` plus the number of data rows.
  </Accordion>

  <Accordion title="end_col omitted" icon="arrows-left-right">
    Becomes `start_col` plus the column count, minus one.
  </Accordion>

  <Accordion title="Mixing" icon="code-merge">
    Each is independent. A fixed `end_row` with `end_col` left out pins the height and lets the width follow the data.
  </Accordion>
</AccordionGroup>

<Warning>
  `start_row` and `end_row` are 1-based, while `start_col` and `end_col` are 0-based.
</Warning>

## Fields

<ParamField path="name" type="str" required>
  Unique identifier. Formulas reference the table by this name.
</ParamField>

<ParamField path="start_row" type="int" required>1-based first row, normally the header.</ParamField>
<ParamField path="start_col" type="int" required>0-based first column.</ParamField>
<ParamField path="end_row" type="int">Optional. Omit it or pass `0` to size from the data.</ParamField>
<ParamField path="end_col" type="int">Optional. Omit it or pass `0` to size from the data.</ParamField>

<ParamField path="display_name" type="str">Friendlier label shown in Excel's table tools.</ParamField>
<ParamField path="style" type="str">A built-in Excel table style name.</ParamField>
<ParamField path="show_first_column" type="bool" default="False">Bolds the first column.</ParamField>
<ParamField path="show_last_column" type="bool" default="False">Bolds the last column.</ParamField>
<ParamField path="show_row_stripes" type="bool" default="True">Alternating row shading.</ParamField>
<ParamField path="show_column_stripes" type="bool" default="False">Alternating column shading.</ParamField>
<ParamField path="show_header_row" type="bool" default="True">Header row with filter dropdowns.</ParamField>
<ParamField path="show_totals_row" type="bool" default="False">Adds a totals row at the bottom.</ParamField>
<ParamField path="column_names" type="list[str]">Override the detected column names.</ParamField>

<Warning>
  A table missing a required key, such as `name`, is dropped silently. No error is raised and the rest of the sheet writes normally, so check that the table is present in the output.
</Warning>

## Styles

Excel ships three families, named by weight:

| Family                      | Range         | Suits                           |
| --------------------------- | ------------- | ------------------------------- |
| `TableStyleLight1` to `21`  | Subtle        | Financial statements, print     |
| `TableStyleMedium1` to `28` | Balanced      | Most reports and dashboards     |
| `TableStyleDark1` to `11`   | High contrast | Executive summaries, highlights |

<Tip>
  To find a style you like, insert a table in Excel and hover over the style gallery. The names appear in the tooltip, and you can paste one straight into `style`.
</Tip>

## Several tables in one sheet

Give each a distinct name and a non-overlapping range:

```python theme={null}
tables = [
    {"name": "Sales",   "start_row": 1,  "start_col": 0, "end_row": 10, "end_col": 3,
     "style": "TableStyleMedium9"},
    {"name": "Summary", "start_row": 13, "start_col": 0, "end_row": 16, "end_col": 2,
     "style": "TableStyleLight16"},
]
```

<Warning>
  Ranges must not overlap. Excel rejects a workbook whose tables collide, and the failure surfaces when someone opens the file rather than when you write it.
</Warning>
