MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

Feature request: Support double lines in tables

Open celtschk opened this issue 10 years ago • 5 comments

Consider the following code, creating a filled Sudoku field with LaTeX:

\begin{array}{||c|c|c||c|c|c||c|c|c||}
\hline\hline
1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
\hline
4 & 5 & 6 & 7 & 8 & 9 & 1 & 2 & 3 \\
\hline
7 & 8 & 9 & 1 & 2 & 3 & 4 & 5 & 6 \\
\hline\hline
2 & 3 & 1 & 5 & 6 & 4 & 8 & 9 & 7 \\
\hline
5 & 6 & 4 & 8 & 9 & 7 & 2 & 3 & 1 \\
\hline
8 & 9 & 7 & 2 & 3 & 1 & 5 & 6 & 4 \\
\hline\hline
3 & 1 & 2 & 6 & 4 & 5 & 9 & 7 & 8 \\
\hline
6 & 4 & 5 & 9 & 7 & 8 & 3 & 1 & 2 \\
\hline
9 & 7 & 8 & 3 & 1 & 2 & 6 & 4 & 5 \\
\hline\hline
\end{array}

In LaTeX, this generates a field with double-lines separating the Sudoku sub-squares. In MathJax, this doesn't work.

My feature request now is to make it work with MathJax. Note that an exact replication of the LaTeX output is not required (indeed, the LaTeX output itself leaves room for improvement). The important part is that the double lines (marked by || for vertical lines, and \hline\hline for horizontal lines) are visibly different from the single lines.

celtschk avatar Oct 10 '15 10:10 celtschk

Thanks for posting this here. The trouble is that our internal format is MathML and MathML does not officially support double-line borders in mtable elements (which is what arrays get converted to). However, since it's standard in CSS, we should add support for it.

pkra avatar Oct 11 '15 11:10 pkra

@pkra, I'm not sure what you have in mind for the internal MathML. Are you suggesting extending the columnlines, rowlines, and frame attributes to include double as well as solid? Or are you suggesting that the TeX input have generate MathML that has style attributes on all the mtd elements to replace the columnlines, rowlines, and frame attributes?

I'm not sure what assistive technology does with mtable lines and frames (if anything), but I suspect that neither option will be accessible.

dpvc avatar Oct 11 '15 17:10 dpvc

I'm not sure what you have in mind for the internal MathML.

Apparently me neither. I incorrectly remembered that Gecko and WebKit accepted double as they are derived from html table implementations; looks like they don't for the obvious reason of using CSS instead of attributes (fun quote: look ma, all those thumbs downs on MDN.

I'm not sure what assistive technology does

I'm not too worried about accessibility since it's standard CSS we're talking about. (And a11y of tables is its own nightmare, apparently. Can't find it but there's a great talk from the a gov a11y person out there.)

Or are you suggesting that the TeX input have generate MathML that has style attributes on all the mtd elements to replace the columnlines, rowlines, and frame attributes?

That's probably better (moving away from MathML attributes, handling CSS better etc). Anyway, v3.0 stuff.

pkra avatar Oct 12 '15 08:10 pkra

I incorrectly remembered that Gecko and WebKit accepted double as they are derived from html table implementations

As you say, they accept double in CSS styles, but not in the columnlines or rowlines attributes (since that is not in the MathML spec).

I'm not too worried about accessibility since it's standard CSS we're talking about

But it is CSS applied to MathML elements, and I doubt that AT will take that into account, or know what it means if they do. Particularly because rowlines and columnlines will have to be set explicitly to none for the CSS styles to work properly, so AT that uses the rowlines or columnlines will get mixed up. Not that I know of any that do anything with the lines anyway. Also, the CSS will have to be applied to each mtd element separately, so instead of being one place where the double is specified, it will have to be on each cell. That means, of course, the individual cells could be treated differently, which makes further complications for AT trying to understand the lines.

That's probably better (moving away from MathML attributes, handling CSS better etc).

It will make for some ugly MathML if you show the math as MathML; but it would be more likely to be portable than trying to extend the rowlines and columnlines values unilaterally.

dpvc avatar Oct 12 '15 11:10 dpvc

The double vertical lines now work in v4.0, but not the double horizontal ones. I'll have to look into adding those.

dpvc avatar Aug 13 '25 20:08 dpvc