# Tables in LaTex

1. Aug 24, 2012

### Stephen Tashi

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.

2. Aug 24, 2012

### LCKurtz

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.

3. Aug 24, 2012

### Greg Bernhardt

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.

4. Aug 24, 2012

### AlephZero

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.

5. Aug 24, 2012

### DrGreg

Consulting our LaTeX FAQ, you can get the effect you want via
Code (Text):

\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}$$