1

I have a table of 2 columns, I want the writing in the left column to be centered and the right column to be aligned to the left.

Using the commands below, the left column is exactly how I want it, but the writing in the left column is aligned to the right but I would like to align it to the left. How can I do this?

\begin{table}[ht]
\begin{tabular}{cc}

\end{tabular}
\end{table}
6
  • Use \begin{tabular}{cl} instead of \begin{tabular}{cc}.
    – Adam Liter
    Jul 31, 2014 at 18:22
  • Thanks for the response! I am getting an error, do I need a certain package to use {c1} instead of {cc}?
    – ekyr
    Jul 31, 2014 at 18:24
  • 1
    It is the letter "L" (though lowercase), not the number one (1). A c centers text in a column, an l left-aligns it, and an r right-aligns it.
    – Adam Liter
    Jul 31, 2014 at 18:25
  • Oh, thanks that really helps. Just one more question: can you tell me how to wrap the text? The text in my right column exceeds the page width. I would appreciate it! :)
    – ekyr
    Jul 31, 2014 at 18:32
  • One option is to put stuff inside of a \parbox (see How to wrap text in table cell?), but there are probably other ways, too. Keep in mind that you can always search this site. There's a lot of good information on the site already! At any rate, welcome to TeX.SX! :)
    – Adam Liter
    Jul 31, 2014 at 18:35

1 Answer 1

4

Column alignment is specified at the beginning of the tabular environment. You currently have cc there, which means that there are two columns and both are centered (c = center). To align a column to the left use l in place of c, and to align it to the right use r. If some of your columns contain lots of text, a paragraph column can be used. Then you also have to provide the width of the column, for example you could use \begin{tabular}{cp{5cm}}. In your case, if I understood correctly, I would suggest that you try \begin{tabular}{cl} instead of \begin{tabular}{cc}. If you want more info about tables in LaTeX (for example how to use the handy \multicolumn command), check out the LaTeX wikibook entry on tables.

0

Not the answer you're looking for? Browse other questions tagged .