List tables: `header-cols` is ignored

Open Beginner friendly
#1,335 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
html, markdown, rust
Domain
documentation

Research direction

The list-table handling lives in the q2 Rust source, where header-rows is already consumed; start by finding that code and checking how header-cols is read from the attributes. Reproduce with the markdown block in the issue and compare the rendered <table> against the expected <th> in the first body column. Done when header-cols=1 gives a row head and the data-header-cols attribute no longer appears.

Written by the indexing model from the issue text.

Description

Tested with q2 0.47.0 on Windows 11.

In pandoc-ext/list-table, header-cols=N (default 0) makes the first N columns of the table body row heads, which HTML renders as <th>. q2 handles header-rows, but ignores header-cols and passes it through as an ordinary attribute.

Repro:

::: {.list-table header-cols=1}
- - Name
  - Initial release
- - Markdown
  - 2004
:::

Actual: <table class="caption-top table" data-header-cols="1">, and the body row is <td>Markdown</td><td>2004</td>.

Expected, as in pandoc-ext/list-table: the attribute is consumed, the table body gets 1 row-head column, and the row renders as <th>Markdown</th><td>2004</td>.

Dominant language
Rust
Stars
316
Forks
23
Avg merge
8h 19m
Merged PRs (30d)
244

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/q2

All issues in quarto-dev/q2

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.