Is it possible to change alignment for individual rows? Example:
+------------+--------------+--------------+
| Left | Center | Right |
+------------+--------------+--------------+
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityIs it possible to change alignment for individual rows? Example:
+------------+--------------+--------------+
| Left | Center | Right |
+------------+--------------+--------------+
Use the \multicolumn
command with 1
as first argument. You may also define a new command (say, \myalign
) as a shortcut.
\documentclass{article}
\newcommand*{\myalign}[2]{\multicolumn{1}{#1}{#2}}
\begin{document}
\begin{tabular}{rll}
(right-aligned) & (left-aligned) & (left-aligned) \\
foo & foo & foo \\
foo & foo & foo \\
\myalign{l}{foo} & \myalign{c}{foo} & \myalign{r}{foo} \\
foo & foo & foo
\end{tabular}
\end{document}
\let\mc\multicolumn
and to use it like \mc1l{foo}
and \mc1c{foo}
because single-character arguments don't need braces.
Jun 12, 2011 at 11:46
\newtabularalignment{rrcll}
.
Jul 31, 2012 at 7:43