# How do I insert a table when asking a question?

I'm having a hard time to insert a table here when I'm asking a question. Any help would be appreciated. Also, is there any, not too expensive, math programs that allow me to enter math terms and equations kind of thing?

Thank you

Tom

• Related on tables: meta.stackexchange.com/questions/73566/… Commented May 17, 2012 at 19:51
• Have to tried www.wolframalpha.com ? :) Commented May 17, 2012 at 19:51
• There is an entry on tables in the MathJax tutorial. Some support for tables is now available also in MarkDown, as illustrated in this answer. Commented Dec 9, 2020 at 4:51

Regarding how to write general math expressions on the site, my answer here covers that well I think.

Specifically for tables, you can use LaTeX's \array command. The tabular command, which only works in text mode, is not available here, so if you want to include text in your table, you will have to do some tinkering. Here is an example table:

$$\begin{array}{c|c|c|} & \text{Column A} & \text{Column B} \\ \hline \text{Row 1} & 5 & \oplus \\ \hline \text{Row 2} & \int & 8 \\ \hline \end{array}$$


produces

$$\begin{array}{c|c|c|} & \text{Column A} & \text{Column B} \\ \hline \text{Row 1} & 5 & \oplus \\ \hline \text{Row 2} & \int & 8 \\\hline \end{array}$$

• +1 Great example! I adapted it to display $$\begin{array}{|c|c|c|}\hline&\zeta (3)&\zeta (2)\\ \hline\sigma&3+4\ln(1+4\sqrt{2})& 2+5\ln\left(\dfrac{1+\sqrt{5}}{2}\right)\\ \hline\tau&-3+4\ln(1+\sqrt{2})&-2+5\ln\left(\dfrac{1+\sqrt{5}}{2}\right)\\ \hline\mu=1+\dfrac{\sigma}{\tau}& \dfrac{8\ln(1+\sqrt{2})}{4\ln(1+\sqrt{2})-3}&\dfrac{10 \ln \left(\dfrac{1+\sqrt{5}}{2}\right)}{5 \ln\left(\dfrac{1+\sqrt{5}}{2}\right)-2}\\ \hline \end{array}$$ Commented May 18, 2012 at 0:24
• +1 Thanks. I had to try it out on one of my answers. Sorry about the bump. Commented May 18, 2012 at 10:45
• Somehow, it doesn't work anymore... Commented Aug 21, 2020 at 12:10

(This is a CW answer, everybody is welcome to extend or improve it.)

Markdown support for tables has been enabled network-wide, this offers an alternative to the MathJax/LaTeX array environment for simple tables. MathJax can be used inside the Markdown table entries.

### A simple example

Source:

| Function | Addition theorem |
| -------- | ---------------- |
| **Sine** | $$\sin(x+y) = \sin(x) \cos(y) + \cos(x) \sin(y)$$ |
| **Cosine** | $$\cos(x+y) = \cos(x) \cos(y) - \sin(x) \sin(y)$$ |


Result:

Sine $$\sin(x+y) = \sin(x) \cos(y) + \cos(x) \sin(y)$$
Cosine $$\cos(x+y) = \cos(x) \cos(y) - \sin(x) \sin(y)$$

### More examples:

Source:

| What | MathJax |
| -------- | -------------- |
| Matrix   | $$\begin{pmatrix}1&2\\0&1\end{pmatrix}$$ |
| Equation with a tag | $$$$x^2+y^2=z^2 \tag{1}$$$$  |
| Centered formula    | $$F_{n+2}=F_{n+1}+F_n$$ |


Result:

What MathJax
Matrix $$\begin{pmatrix}1&2\\0&1\end{pmatrix}$$
Equation with a tag $$$$x^2+y^2=z^2 \tag{1}$$$$
Centered formula $$F_{n+2}=F_{n+1}+F_n$$

### Notes

• There is currently a bug when MathJax is used in the Markdown table header.

Since my example given in a comment to Zev Chonoles's answer and adapted from it, due to some reason, does not display properly now, I repeat it here.

$$\begin{array}{|c|c|c|}\hline&\zeta (3)&\zeta (2)\\\hline\sigma&3+4\ln(1+4\sqrt{2})&2+5\ln\left(\dfrac{1+\sqrt{5}}{2}\right)\\\hline\tau&-3+4\ln(1+\sqrt{2})&-2+5\ln\left(\dfrac{1+\sqrt{5}}{2}\right)\\\hline\mu=1+\dfrac{\sigma}{\tau}&\dfrac{8\ln(1+\sqrt{2})}{4\ln(1+\sqrt{2})-3}&\dfrac{10\ln\left(\dfrac{1+\sqrt{5}}{2}\right)}{5\ln\left(\dfrac{1+\sqrt{5}}{2}\right)-2}\\\hline\end{array}$$

It is produced by

$$\begin{array}{|c|c|c|} \hline &\zeta (3)&\zeta (2)\\ \hline \sigma&3+4\ln(1+4\sqrt{2})&2+5\ln\left(\dfrac{1+\sqrt{5}}{2}\right)\\ \hline \tau&-3+4\ln(1+\sqrt{2})&-2+5\ln\left(\dfrac{1+\sqrt{5}}{2}\right)\\ \hline \mu=1+\dfrac{\sigma}{\tau}&\dfrac{8\ln(1+\sqrt{2})}{4\ln(1 \sqrt{2})-3}& \dfrac{10\ln\left(\dfrac{1+\sqrt{5}}{2}\right)} {5\ln\left(\dfrac{1+\sqrt{5}}{2}\right)-2}\\ \hline \end{array}$$

• Amusingly, without even first looking at your post, I noticed that your comment had broken and then proceeded to fix it, figuring that it's the same problem I was having here. Should I rebreak it? Commented Jun 5, 2012 at 13:13
• That or perhaps better you could add a short comment explaining how you have fixed it. Commented Jun 5, 2012 at 13:48