Wrong markdown table headers rendering #366

Closed
opened 2025-11-02 03:20:22 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @andrew-boyarshin on GitHub (Feb 19, 2017).

Description

Table headers are measured separately from table body content. The exact reason is unknown, yet my PR seems to have triggered this error.

Originally spotted during my PR development - ignored due to buggy dev environment. Yet, it is now confirmed to be the problem thanks to @Lourens-Rich.

Possible solution

If you remove display: block from table CSS, that is _markdown.less#L243, the problem goes away. But it makes table 100% wide in parent container. The solution to that is width: auto instead of width: 100% on the next line, that is also the way it is done in Semantic UI (collapsing class on table).

If maintainers confirm that is the way to go, I can create PR with this fix.

Screenshots

chrome_2017-02-19_18-15-57


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Originally created by @andrew-boyarshin on GitHub (Feb 19, 2017). - Gitea version: 1.0.0+289-gdbe6d2ff (from [try.gitea.io](https://try.gitea.io)) - Can you reproduce the bug at [try.gitea.io](https://try.gitea.io): - [x] Yes ([try.gitea.io/STALKER_2010/Education](https://try.gitea.io/STALKER_2010/Education)) - [ ] No - [x] Not relevant ## Description Table headers are measured separately from table body content. The exact reason is unknown, yet [my PR](https://github.com/go-gitea/gitea/pull/186#issuecomment-279126120) seems to have triggered this error. Originally spotted during my PR development - ignored due to buggy dev environment. Yet, it is now confirmed to be the problem thanks to @Lourens-Rich. ## Possible solution If you remove ```display: block``` from table CSS, that is [_markdown.less#L243](https://github.com/go-gitea/gitea/blob/master/public/less/_markdown.less#L243), the problem goes away. But it makes table 100% wide in parent container. The solution to that is ```width: auto``` instead of ```width: 100%``` on the next line, that is also the way it is done in Semantic UI (```collapsing``` class on table). If maintainers confirm that is the way to go, I can create PR with this fix. ## Screenshots ![chrome_2017-02-19_18-15-57](https://cloud.githubusercontent.com/assets/3063662/23101829/90ff387e-f6cf-11e6-9cce-903b47fc1ccd.png) <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/42198162-wrong-markdown-table-headers-rendering?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github). </bountysource-plugin>
GiteaMirror added the type/bug label 2025-11-02 03:20:22 -06:00
Author
Owner

@andreynering commented on GitHub (Feb 19, 2017):

Thank you @andrew-boyarshin

If that would fix the issue, we would be happy to receive a PR for it.

@andreynering commented on GitHub (Feb 19, 2017): Thank you @andrew-boyarshin If that would fix the issue, we would be happy to receive a PR for it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#366