# Tables in LaTex

## Main Question or Discussion Point

Do LaTex tables work in forum posts? I've never used them before. Today I tried copying several examples from pages on the web such as:

$$\begin{tabular}{ l c r } 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{tabular}$$

which on my browser doesn't show up as a table. I tried using math renderers HTML-CSS and SVG.
I don't see any syntax error in that example, but, as I said, I've never tried to write tables in LaTex before.

Related MATLAB, Maple, Mathematica, LaTeX News on Phys.org
LCKurtz
Homework Helper
Gold Member
Do LaTex tables work in forum posts? I've never used them before. Today I tried copying several examples from pages on the web such as:

$$\begin{tabular}{ l c r } 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{tabular}$$

which on my browser doesn't show up as a table. I tried using math renderers HTML-CSS and SVG.
I don't see any syntax error in that example, but, as I said, I've never tried to write tables in LaTex before.
That syntax is fine for a LaTeX document. I'm no expert on this, but I think "tabular" is an environment variable, and they aren't generally supported here.

Disclaimer: Someone who knows what they are talking about may correct me.

We use MathJax which accepts most LaTeX commands, but it does not accept the tabular environment. Some here have used Arrays to fake a table.

AlephZero
Homework Helper
On PF (and presumably any MathJax application) your input is interpreted in LaTex "math mode", as if it were between $\ \dots \$ or $\\ \dots \\$ in "standard" LaTeX.

So you can't use environments like "tabular" that are meant to be used outside of math mode.

DrGreg
Gold Member
Do LaTex tables work in forum posts? I've never used them before. Today I tried copying several examples from pages on the web such as:

$$\begin{tabular}{ l c r } 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ \end{tabular}$$

which on my browser doesn't show up as a table. I tried using math renderers HTML-CSS and SVG.
I don't see any syntax error in that example, but, as I said, I've never tried to write tables in LaTex before.
Consulting our LaTeX FAQ, you can get the effect you want via
Code:
\begin{array}{| l | c | r |}
\hline
1 & 2 & 3 \\
\hline
4 & 5 & 6 \\
\hline
7 & 8 & 9 \\
\hline
\end{array}
$$\begin{array}{| l | c | r |} \hline 1 & 2 & 3 \\ \hline 4 & 5 & 6 \\ \hline 7 & 8 & 9 \\ \hline \end{array}$$