How to create a horizontal table of value using Latex? I want to put values of x and y.

Printable View

- Jun 4th 2008, 01:49 PMarbolisHow to...
How to create a horizontal table of value using Latex? I want to put values of x and y.

- Jun 4th 2008, 01:56 PMMoo
$\displaystyle \begin{tabular}{|*{2}{c|}l r| l}

\hline

centre & centre & gauche & droite \\

case centree & encore centrée & a gauche & a droite \\

% On trace 2 lignes

\hline

\hline

case centree & encore centree & a gauche & a droite \\

\end{tabular}$

LaTeX - Gestion des tableaux

I'm sorry for other people than arbolis, but it's in French :D

\hline is for horizontal line. The first command gives the table format, with columns or vertical lines, etc... :) - Jun 4th 2008, 01:59 PMJhevon
- Jun 4th 2008, 01:59 PMarbolis
Thanks a lot!

- Jun 4th 2008, 02:01 PMarbolisQuote:
- Jun 4th 2008, 02:07 PMJhevon
what do you mean a vertical one? that table is kind of vertical. did you mean horizontal? like:

$\displaystyle \begin{array}{c|ccc} x & 1 & 2 & 3 \\ \hline y & 1 & 2 & 3 \end{array}$

and of course, we can add more vertical or horizontal lines if we want. even an outline... - Jun 4th 2008, 02:08 PMarbolisQuote:
- Jun 4th 2008, 02:12 PMJhevon
- Jun 4th 2008, 04:49 PMKrizalid
Pick google and write "latable." Download it.

- Jun 4th 2008, 05:04 PMarbolisQuote:

this code will be slightly harder to modify. you need to add more "c"'s to get more columns. and you fill in all the x's before the y's underneath them

Quote:

Pick google and write "latable." Download it.

- Jun 4th 2008, 05:15 PMarbolis
I've found "Latable" on your forum. Seems an easy an nice maker of tables. When I enter some data and I copy them as Latex, I got

Quote:

\begin{tabular}{llll}

x & y & z & a \\

1 & 0 & 0 & 1 \\

2 & 0 & 1 & 1 \\

3 & 10^{\frac{1}{9}} & 1 & 1 \\

\end{tabular}

- Jun 5th 2008, 09:02 AMKrizalid
- Jun 5th 2008, 09:26 AMarbolisQuote:

This happens here, but not in other forums. Are you makin' a PDF?

- Jun 6th 2008, 03:43 AMOpalg
Table entries in the tabular environment are treated as text, not mathematics. If you wrap the item 10^{\frac{1}{9}} with dollar signs, to get

\begin{tabular}{llll}

x & y & z & a \\

1 & 0 & 0 & 1 \\

2 & 0 & 1 & 1 \\

3 & $10^{\frac{1}{9}}$ & 1 & 1 \\

\end{tabular}

then it will typeset as $\displaystyle \begin{tabular}{llll}

x & y & z & a \\

1 & 0 & 0 & 1 \\

2 & 0 & 1 & 1 \\

3 & $10^{\frac{1}{9}}$ & 1 & 1 \\

\end{tabular}$.

But it will still look wrong, because the symbols x, y, z, a in the top row have the wrong font shape. You should really replace the tabular environment by the array environment, which is similar except that the matrix entries will will treated as mathematical. So

\begin{array}{llll}

x & y & z & a \\

1 & 0 & 0 & 1 \\

2 & 0 & 1 & 1 \\

3 & 10^{\frac{1}{9}} & 1 & 1 \\

\end{array}

produces $\displaystyle \begin{array}{llll}

x & y & z & a \\

1 & 0 & 0 & 1 \\

2 & 0 & 1 & 1 \\

3 & 10^{\frac{1}{9}} & 1 & 1 \\

\end{array}$.