Tests for MathML 4 mtable presentation attributes via mtable/mtable.js.
Each row repeats the same MathML twice: the middle column is outside any polyfill wrapper (native
mtable); the right column is wrapped in mtable-test-polyfill-root and processed with
_MathTransforms.transform so you can compare native rendering with the polyfill. Unless a case is
explicitly a 0×0 or 1×1 table, every mtable here has at least two non-empty rows or two non-empty
columns. mlabeledtr tests are at the end of the page.
align (whole table)Baseline reference x on both sides of the table in each row.
| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
align="top" |
|
|
align="bottom" |
|
|
align="center" |
|
|
align="baseline" |
|
|
align="axis" (default) |
|
align with row number| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
align="baseline,1" and align="baseline, 2" |
|
|
align="baseline,-2" and align="baseline, -1"(should display the same as above row) |
|
|
align="axis,1" and align="axis,2" |
|
|
align="axis,-2" and align="axis,-1"(should display the same as above row) |
|
rowalign| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
| Test all the rowalign attributes. |
|
mtr rowalign and columnalignPer MathML 4, mtr may set rowalign and columnalign (space- or comma-separated lists, one token per column, last repeated) to override the enclosing mtable for that row only; mtd can override again.
| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
mtable rowalign="center" columnalign="right"; second mtr uses rowalign="top, baseline, bottom" and columnalign="left center right". |
|
mtable → mtr → mtdmtable sets rowalign="bottom" and columnalign="right" (lists repeat per row / column).
Each mtr overrides with its own rowalign / columnalign lists
Selected mtd elements override again.
Each cell is prefixed with (r, c) for the resolved alignment (bot for bottom; otherwise the first letter of rowalign / columnalign).
| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
Defaults on mtable; per-row lists on mtr; mtd overrides as in the list below.Each cell starts with (r, c), telling what the rowalign / columnalign should be.The first letter of the attr value is used, except bot = bottom. |
|
|
|
Override map (row 0 = top of
|
||
columnalignThree rows; columnalign="left center right"; columns have very different widths.
| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
| Left, center, and right alignment per column |
|
| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
columnwidth="auto 6em fit" with width="28em" |
|
|
width="50%" |
|
| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
rowspacing="0.1ex 0.7ex 2ex" |
|
|
columnspacing="0.1em 2em" |
|
| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
rowlines="dashed none solid" |
|
|
columnlines="dashed none solid" |
|
|
frame="solid" |
|
|
frame="dashed" |
|
|
frame="solid" with framespacing="2em 2ex" |
|
|
frame="solid", rowlines="dashed dashed",
columnlines="dashed dashed" |
|
equalrows, equalcolumns| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
equalrows="true" |
|
|
equalcolumns="true" |
|
|
equalrows="true" equalcolumns="true" |
|
displaystyle| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
No displaystyle attribute (MathML 4 default false inside table). |
|
|
displaystyle="true" |
|
mathcolor with rules| Description | Native mtable (no polyfill on this subtree) |
After _MathTransforms.transform |
|---|---|---|
mathcolor on parent math with frame and row/column lines. |
|
mlabeledtrLabeled equation rows are expanded to mtr inside mtable/mtable.js (padding
mtd on other rows, intent on the label). On mlabeledtr, rowalign /
columnalign lists apply to equation mtds only; the label column uses mtable
defaults for that row/column. On mtable, column-wise lists (columnalign,
columnwidth, and mtr rowalign / columnalign) use list index
n−1 for the label column so the first token is for the first equation column.
columnspacing and rowspacing still use physical column/row gaps.
columnlines list tokens apply only between equation columns (no rule between the label column and the equation block).
The frame border wraps equation columns only (the label sits outside that outline).
rowlines are drawn on equation cells only so they do not extend through the label column.
Compare native (middle) with the polyfill (right).
| Description | Native (no polyfill on this subtree) | After _MathTransforms.transform |
|---|---|---|
Default mtable@side (right): label (2.1) on the right of the first row. |
|
|
mtable side="left": label on the left of the labeled row (second row here). |
|
|
Label intent: with property :equation-label (console error if data-expected does not match). |
|
|
mtable columnalign="left center right" columnlines="solid dashed" the first row is labeled |
|
|
mtable columnwidth="7em auto"columnlines="solid" columnspacing="1em 1em" the first row is labeled |
|
|
Label on the first and third row.mtable:
frame="solid" rowlines="solid" columnlines="dashed" rowspacing="0.6ex" columnspacing="0.5em 1.2em" |
|
|
Label on the left side of the table.mtable side="left" with columnalign="center right left" columnlines="solid" on mlabeledtr.
|
|
|
First row should align on top, then baseline, and label falls back to the mtable's rowalign="bottom".Second row should align on bottom mtable with rowalign="bottom"mlabeledtr with rowalign="top baseline" columnalign="left right"
|
|