# Latex Table Question

Here's a link to a SE question-answer on building tables using Latex. I copied the following bit of Latex code from the top-rated answer and when I pasted it in to an answer on Chemistry SE it didn't produce the expected part of the table. Is Latex not fully supported on Chemistry SE, or did I make some kind of error?

\begin{table} \centering \caption{A data table.} \label{tbl:1} \begin{tabular}{c c} A & B \\ C & D \end{tabular} \end{table}

EDIT: So if the {table} method doesn't work in MathJax, how, using the {align} method, could I rework the table MannishEarth created in his answer, but with the first row continuous (no columns in only the first row) with "123" centered within it

The \begin{table}...\end{table} would create a floating object, which is not really possible in a website anyways.

Since \multicolumn{3}{c}{1 2 3} is not permitted in arrays, arrays inside arrays is your only option.

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

• Thanks Martin, I'm going to play around with this.
– ron
Jul 1 '14 at 14:06
• @ron You are welcome, however, I would recommend avoiding them as often as possible, it is almost always coding pain, as it is easy to forget a parentheses/ closing argument... and then you are searching longer for the error than it took to post the answer :/ Jul 2 '14 at 9:05

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

\begin{array} works (right click for mathjax source)

That being said, MathJax only supports a subset of LaTeX. It's not for general typesetting, so expect a lot of LaTeX features to be missing.

• @MannishEarth Thanks Mannish! "expect a lot of LaTeX features to be missing" Aha, I guess that explains it. I did wind up using the "\begin{array}" method. If I wanted the first row to be continuous (no columns in only the first row) with "123" centered within it, is there a way to accomplish that?
– ron
Jun 29 '14 at 20:51
• @ron uh, I think so, but I forgot exactly how the LaTeX array syntax works. Jun 30 '14 at 7:06
• The background is that MathJax focuses on math-mode LaTeX. The table environment is a text-mode macro and thus not in scope (it fits more naturally with markdown, I suppose). For a complete list of TeX macros supported by MathJax, see docs.mathjax.org/en/latest/tex.html#supported-latex-commands Jun 30 '14 at 9:01
• Thanks for the link Peter. The link on that page leading to Carol Fisher's treasure trove of MathJax illustrated commands was a good one too. onemathematicalcat.org/MathJaxDocumentation/TeXSyntax.htm
– ron
Jun 30 '14 at 13:12
• Be aware, that you will have to escape text in tables via \text{...}, otherwise it will be set as variables. Unfortunately on meta.se it does not say why the status is declined: meta.stackexchange.com/q/73566/260760 Jul 1 '14 at 10:45