HTML writer drops table column widths: <col /> without style="width"
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
Start in pampa/src/writers/html.rs and inspect the colgroup_kept_when_any_width_set test and the HTML table writer; the issue says the colspec already contains percentages for sections A and D. Render the supplied widths.qmd example to HTML and check whether each percentage column gets a width style. The separate pipe table dash-width reader gap is out of scope for this writer change.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Table column widths never reach the HTML output. The reader produces the right ColWidth values (both for tbl-colwidths and for ::: {.list-table widths="…"}), the writer decides a <colgroup> is needed because of them, and then writes every column as a bare <col />. Quarto 1 writes <col style="width: 20%"> for the same input.
The writer already knows: pampa/src/writers/html.rs has a test colgroup_kept_when_any_width_set whose comment says "The width itself isn't rendered yet — only the presence check" (bd-hixmy, from the table-default-rendering-parity plan, which scoped widths out). This issue is the user-visible symptom, filed so it is tracked somewhere findable: a docs site porting a fixed-layout config table (table-layout: fixed needs the <col> widths) had to reproduce them in CSS with col:nth-child(n) rules.
Repro
widths.qmd:
---
title: column widths
---
## A tbl-colwidths on a pipe table
| Key | Description | Type | Default |
|---|---|---|---|
| a | b | c | d |
: {tbl-colwidths="[20,40,15,25]"}
## B pipe table with relative dash widths (line over 72 chars)
| Key | Description | Type | Default |
|------|--------------------------|-------|----------------|
| a | a long description that pushes this line well past the seventy-two column limit | c | d |
## D list-table with widths
::: {.list-table widths="20,40,15,25"}
* - Key
- Description
- Type
- Default
* - a
- b
- c
- d
:::
quarto render widths.qmd --to html --output-dir q1
q2 render widths.qmd --to html --output-dir q2out
<col> elements per section:
| Section | Quarto 1 (99.9.9 dev) | q2 0.35.0-nightly.20261021 |
|---|---|---|
A tbl-colwidths |
<col style="width: 20%"> 40% 15% 25% |
no <colgroup> at all, plus an empty <caption> </caption> |
| B dash-width pipe table | <col style="width: 10%"> 47% 12% 29% |
no <colgroup> |
D list-table widths |
<col style="width: 20%"> 40% 15% 25% |
<colgroup> with four bare <col /> |
AST colspecs (q2 render --to json vs quarto pandoc -t json):
- A: q2
ColWidth 0.2 / 0.4 / 0.15 / 0.25(the reader foldstbl-colwidthsinto the colspec, which Quarto 1 only does later in a filter: its pandoc AST showsColWidthDefault). So for A the reader is ahead of the writer, and only the writer is missing. - D: q2
ColWidth 0.2 / 0.4 / 0.15 / 0.25. Same: writer only. - B: q2
ColWidthDefault×4, Quarto 1 / pandoc0.109 / 0.473 / 0.127 / 0.291. Pandoc's rule (relative widths from the separator-row dash counts when any line exceeds the column width) is not implemented intreesitter_utils/pipe_table.rs(colspec.push((alignment, ColWidth::Default))). That is a reader gap, mentioned here only so the three cases are in one place; split it out if you prefer.
Expected
<col style="width: NN%"> per column whenever the colspec has a ColWidth::Percentage, matching Quarto 1 / pandoc's HTML writer (percentages rounded to integers, as pandoc does). Section A should also not emit an empty <caption> when the caption block only carries attributes.
Environment
q2 0.35.0-nightly.20261021 (macOS arm64); repo at ad283a2cb. Quarto 1 at 99.9.9 (dev build from quarto-cli).
- Ngôn ngữ chính
- Rust
- Star
- 278
- Fork
- 19
- Merge trung bình
- 20 giờ 23 phút
- Pull request đã merge (30 ngày)
- 164
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quarto-dev/q2
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 54/100
quarto-dev/q2#905 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 63/100
quarto-dev/q2#904 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 48/100
quarto-dev/q2#900 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
quarto-dev/q2#896 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
"I want :emoji: to work"Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
quarto-dev/q2#893 · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quarto-dev/q2
Issue tương tự
-
checkpoint/verify/rebuild_indexes on a thread holding a WriteTransaction deadlock instead of INT-001Đang mởbug known-issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
project-minigraf/minigraf#734 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug CLI documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
openai/codex#56630 · 3 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
DayuanJiang/PecoFence#139 ·
Maintainer thường phản hồi trong vòng 1 ngày