[Tex/LaTex] Aligning inside tabular environment, specific cell

horizontal alignmenttables

I'm trying to align a specific content of a single cell.
For example,

\begin{tabular}{|r|r|}
   \hline
   1 & 2 \\
   \hline
   right & to \_ the \_ left \\
   \hline
   1 & 2 \\
   \hline
\end{tabular}

Is it possible to_the_left to be aligned to the left, but to leave all others on the right? Is it even possible to align (cell contents) inside an already defined tabular environment?

Best Answer

You can use \multicolumn{1}{l}{<content>} for to_the_left to switch the cell alignment just for this cell. If you want to have a vertical line you need to use l| instead, otherwise the line is missing for this cell.

\documentclass{article}
\begin{document}
\begin{tabular}{|r|r|}
   \hline
   111111 & 222222 \\
   \hline
   right & \multicolumn{1}{l|}{left} \\
   \hline
   1 & 2 \\
   \hline
\end{tabular}
\end{document}

Result