Skip to content

fix(tables): render headerless tables (| | |) - #16

Merged
b451c merged 1 commit into
b451c:mainfrom
shmuelzon:fix-tables-without-titles
Jul 27, 2026
Merged

fix(tables): render headerless tables (| | |)#16
b451c merged 1 commit into
b451c:mainfrom
shmuelzon:fix-tables-without-titles

Conversation

@shmuelzon

Copy link
Copy Markdown
Contributor

A table whose header row is entirely empty cells vanished from the render. The parser took its column count from the header row, and parseTableRow trims trailing empty cells — so | | | collapsed to zero cells, every data row was normalized to zero columns, and the table views iterated an empty range. Only the border and header divider showed.

  • Parser: the separator row is authoritative for column count; the header row is padded to that width like data rows already were.
  • TableBlockView / PrintableTableView: skip the header band entirely when every header cell is blank, so a headerless table reads as the definition-list layout it is meant to be rather than an empty strip. Both also derive columnCount defensively and index headers safely.

A table whose header row is entirely empty cells vanished from the
render. The parser took its column count from the header row, and
parseTableRow trims trailing empty cells — so `| | |` collapsed to zero
cells, every data row was normalized to zero columns, and the table views
iterated an empty range. Only the border and header divider showed.

- Parser: the separator row is authoritative for column count; the header
  row is padded to that width like data rows already were.
- TableBlockView / PrintableTableView: skip the header band entirely when
  every header cell is blank, so a headerless table reads as the
  definition-list layout it is meant to be rather than an empty strip.
  Both also derive columnCount defensively and index headers safely.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@b451c

b451c commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Merged - and with impeccable timing: I hit this exact bug an hour before your PR landed, building a demo document with a definition-style table. Making the separator row authoritative for column count is the right root-cause fix, and skipping the header band for all-blank headers reads much better than an empty strip. The defensive columnCount and safe header indexing are appreciated too.

Verified: unit test green, full suite passes, and the fix confirmed visually in a running build. Ships in v1.7.0. Thank you!

@b451c
b451c merged commit ee3cf48 into b451c:main Jul 27, 2026
3 checks passed
@shmuelzon
shmuelzon deleted the fix-tables-without-titles branch July 27, 2026 20:52
@b451c

b451c commented Jul 27, 2026

Copy link
Copy Markdown
Owner

v1.7.0 with this change is now live: https://github.com/b451c/quickmd/releases/tag/v1.7.0 - thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants