> ## 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.

# Formatting basics

> The handful of options that make a sheet readable

A default export is a bare grid: unstyled header, columns sized to nothing in particular, nothing frozen. These options fix that, and they're the ones worth knowing by heart.

## Headers

<ParamField path="styled_headers" type="bool" default="False">
  Bolds the first row. Verified against 0.3.1: this applies bold only, with no fill, despite the source describing it as bold plus gray.
</ParamField>

<ParamField path="write_header_row" type="bool" default="True">
  Whether column names are written at all. Set `False` when appending to a template that already has headers, or exporting data only.
</ParamField>

<Tip>
  If you want shaded headers, add a `cell_styles` entry with a `fill` for each header cell. `styled_headers` won't do it.
</Tip>

## Freezing and filtering

<ParamField path="freeze_rows" type="int" default="0">
  Rows that stay in place while the rest scrolls. `1` pins the header.
</ParamField>

<ParamField path="freeze_cols" type="int" default="0">
  Same for columns. `1` pins the leftmost column, which helps when it holds names or IDs.
</ParamField>

<ParamField path="auto_filter" type="bool" default="False">
  Adds filter dropdowns to the header row.
</ParamField>

```python theme={null}
jet.write_sheet_arrow(
    df.to_arrow(), "out.xlsx",
    styled_headers=True,
    freeze_rows=1,
    freeze_cols=1,
    auto_filter=True,
)
```

## Column widths

<ParamField path="auto_width" type="bool" default="False">
  Sizes every column to fit its contents.
</ParamField>

<ParamField path="column_widths" type="dict[str, float | str]">
  Per-column override keyed by column name. Accepts a number in Excel character units, a pixel string such as `"150px"`, or `"auto"`.
</ParamField>

The two combine. Turn on `auto_width` and override only the columns that need it:

```python theme={null}
jet.write_sheet_arrow(
    df.to_arrow(), "out.xlsx",
    auto_width=True,
    column_widths={
        "ID": 8.0,           # narrow, fixed
        "Notes": 60.0,       # wide for prose
        "Email": "200px",    # pixels if you prefer
    },
)
```

<Tip>
  `auto_width` reads every row to measure content, so it costs time on large frames. On a million-row export, set explicit widths instead. The project's own guidance is to disable auto-width for speed.
</Tip>

## Row heights

<ParamField path="row_heights" type="dict[int, float]">
  Height in points, keyed by 1-based row number.
</ParamField>

<ParamField path="default_row_height" type="float">
  Applies to every row. Excel's own default is 15.
</ParamField>

## Header content above the data

When a report needs a title block above the table, write it with `header_content` and push the DataFrame down with `data_start_row`.

<ParamField path="header_content" type="list[tuple[int, int, str]]">
  Tuples of `(row, col, text)` written before the data. Rows are 1-based, columns 0-based.
</ParamField>

<ParamField path="data_start_row" type="int" default="0">
  Row where the DataFrame begins. It also excludes the rows above it from `auto_width` measurement, so a long title doesn't stretch column A.
</ParamField>

```python theme={null}
jet.write_sheet_arrow(
    df.to_arrow(), "report.xlsx",
    header_content=[
        (1, 0, "ACME Corporation"),
        (2, 0, "Q4 Sales Report"),
        (3, 0, "Generated 2026-01-15"),
    ],
    data_start_row=5,
    write_header_row=True,
    auto_width=True,
    merge_cells=[(1, 0, 1, 1)],
)
```

<Warning>
  Row and column indexing isn't consistent across the API. See [Conventions](/guides/conventions) for the full table before you set positions.
</Warning>

## Putting it together

```python theme={null}
jet.write_sheet_arrow(
    df.to_arrow(),
    "employees.xlsx",
    sheet_name="Employees",
    styled_headers=True,
    freeze_rows=1,
    auto_filter=True,
    auto_width=True,
    column_formats={"Salary": "currency"},
)
```
