# $x$ to $f(x)$ chart using MathJax (LaTeX)? [duplicate]

Is it possible to do a simple x-y table in MathJax for Math StackExchange questions? Something like this:

I admit it would probably be a waste of time for most questions, but I'm sure it could have some applications.

$$\begin{array}{|c|c|} \hline x & y \\\hline -2 & -8\\\hline -1 & -6.5\\\hline 0 & -5\\\hline 1 & -3.5\\\hline 2 & -2\\\hline \end{array}$$
$$\begin{array}{|c|c|} \hline x & y \\\hline -2 & -8\\\hline -1 & -6.5\\\hline 0 & -5\\\hline 1 & -3.5\\\hline 2 & -2\\\hline \end{array}$$

• @Zack: As a purely cosmetic note, replacing |c|c| with |r|l| in this markup duplicates the alignment in your image. There are many other options as you might imagine. – J. W. Perry Aug 25 '14 at 0:54