tabular vertical align by xworld21 · Pull Request #2843 · brucemiller/LaTeXML · GitHub
Skip to content

tabular vertical align - #2843

Open
xworld21 wants to merge 2 commits into
brucemiller:masterfrom
xworld21:tabular-vertical-align
Open

xworld21 wants to merge 2 commits into
brucemiller:masterfrom
xworld21:tabular-vertical-align

Conversation

@xworld21

@xworld21 xworld21 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Fix #2732 plus more side effects (hopefully all good).

The three notable changes are:

  • Columns p, m, b don't get vattach anymore. This is a no-brainer: the vattach is already on the inline-block for those column types (in fact, you had already fixed the core issue, the only remaining problem was the extra @vattach).
  • The top/bottom vertical alignments now opt into using baseline-source, which behaves like TeX; this also produces better alignment between tags and text in lists. This should be low risk. I am only worried by MathML, because some CSS stops working there.
  • All table cells default to vertical-align:baseline instead of middle. This is dangerous! I had to revert the change in equation cells, because tags are pretty much hard-coded to ltx_align_middle. I believe that all other <table>s are generated from tabular, \halign, and other TeX constructs for which the baseline alignment is correct, so in theory this is all fine.

I checked that the result works in all three main browsers (Chrome, Safari, Firefox). Firefox does not implement baseline-source, so it falls back to the less precise vertical-align:top.

Note: while the CSS spec says authors should prefer the shorthand vertical-align: first baseline, Chrome only supports the longhand baseline-source. That's why I used @supports.

@brucemiller

Copy link
Copy Markdown
Owner

@dginev

dginev commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Could you comment on "works in Safari" - is the MDN page outdated? They claim it isn't included in the browser Baseline effort due to Safari not having a plan to add support, if I am reading it right:

image

https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/baseline-source#browser_compatibility

@xworld21

xworld21 commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor Author

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.

incorrect vertical-align settings with tabular

3 participants