Table Header Row: Telling Headings from Data
The header row is the row of column names at the top of a table. HTML marks it up with `<thead>` or `<th>`, but plenty of pages skip that, so a tool has to guess and let you override. The choice decides which cells become headings in an export.
Why it matters
The first row of a table usually contains column names. But not always. Some tables have no header row at all; some have styled headers that aren't marked up as such; some have multiple header rows. How Scalpel treats that first row affects how your export looks and reads.
In Markdown, a header row becomes the top line with dashes underneath it. In a rich copy to Google Sheets or Excel, a header row becomes <th> cells styled differently. In plain CSV, every cell is the same. The setting lets you tell Scalpel whether to treat the first row as headings or as data, and that choice matters when you're copying or downloading.
How it works
Scalpel reads the HTML markup first. If the table uses <thead>, Scalpel marks those cells as the header. If cells are marked with <th>, they're treated as headings. If an ARIA-aware table sets columnheader or rowheader roles, those are read as headers too. That's the auto-detection.
But plenty of pages skip the markup. A header row might be styled with bold text or a background colour but not wrapped in proper HTML. In those cases, Scalpel makes a guess: if the first row is structurally different from the others (different number of cells, different content shape), it's probably a header. If the first row looks identical to all the others, it's probably data.
The "First row is header" control in the footer lets you override that guess. You can choose auto (Scalpel's best guess), yes (force the first row to be a header), or no (force it to be data). Your choice applies to every export until you change it again.
What does not matter
Multiple header rows and merged cells in headers are valid HTML, not errors. If a table has two rows of headings, Scalpel preserves both and treats them both as headers in the export. The HTML spec allows it; it doesn't make the table wrong.
Also, the header setting only affects the presentation and metadata, not the data itself. Changing "yes" to "no" won't lose any cells or content. It just changes which cells render as headings in Markdown or rich formats. The raw data stays the same.
Code example
A table with a proper header:
<table>
<thead>
<tr>
<th>Name</th>
<th>Department</th>
<th>Years</th>
</tr>
</thead>
<tbody>
<tr><td>Alice</td><td>Engineering</td><td>5</td></tr>
<tr><td>Bob</td><td>Sales</td><td>3</td></tr>
</tbody>
</table>
Scalpel detects the <thead> automatically and treats those cells as headings.
But when the header is styled but not marked up:
<table>
<tr style="font-weight: bold; background: #ccc;">
<td>Name</td>
<td>Department</td>
<td>Years</td>
</tr>
<tr><td>Alice</td><td>Engineering</td><td>5</td></tr>
<tr><td>Bob</td><td>Sales</td><td>3</td></tr>
</table>
Scalpel's auto-detection might guess correctly that the first row is the header. But if you want to be certain, you can set it to "yes" in the footer.
When exported as Markdown with the header row set correctly, both become:
| Name | Department | Years |
|-------|--------------|-------|
| Alice | Engineering | 5 |
| Bob | Sales | 3 |
How Scalpel shows it
The "First row is header" control sits in the table card's footer, alongside the Transpose toggle and the copy buttons. It shows three options: auto (Scalpel's guess), yes (force header), or no (force data). The default is auto. Change it and the preview updates immediately to show how your Markdown or rich copy will look.
The setting is remembered while the popup is open, so every export from that table uses your choice. Close and reopen the popup, and the setting resets to auto for a fresh detection pass.