We use cookies on this site. By browsing our site you agree to our use of cookies. Close this message Find out more

More in this section LateX

# Basic Tables

To create a basic table in LateX, use the following code:

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

Note how you can add horizontal or vertical lines wherever you please, using the "|" character or using the "\hline" command.

• You can add a column by changing "{l c r}" to "{l c c r}" at the beginning of your table.
• You can add a row by simply entering another line of data below with the appropriate formatting.

Basic Tutorials: