In the following table (code included below), how can I vertically center the text RowName1? (note that each bulleted list must be within a minipage environment).
Code:
\documentclass[letter]{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{cp{2in}p{2in}}
\toprule
& \multicolumn{1}{c}{\textbf{ColName1}} & \multicolumn{1}{c}{\textbf{ColName2}} \\
\midrule
\textbf{RowName1}
&
\begin{minipage}[t]{\linewidth}
\begin{itemize}
\item 1
\item 2
\end{itemize}
\end{minipage}
&
\begin{minipage}[t]{\linewidth}
\begin{itemize}
\item 1
\item 2
\item 3
\item 4
\end{itemize}
\end{minipage}
\\
\bottomrule
\end{tabular}
\end{document}
ADDENDUM
It would also be useful, if the same effect could be achieved without using minipages. I have tried to do so (see code below), but get the following:
This is problematic for two reasons: (a) RowName1 is not vertically aligned, and (b) there's extra space before and after the bullet lists.
The code used is:
\documentclass[letter]{article}
\usepackage{booktabs,enumitem,array}
\begin{document}
\begin{tabular}{p{1in}p{2in}p{2in}}
\toprule
& \multicolumn{1}{c}{\textbf{ColName1}} & \multicolumn{1}{c}{\textbf{ColName2}} \\
\midrule
\textbf{RowName1}
&
\begin{itemize}[topsep=0em, partopsep=0em, parsep=0em, itemsep=0em, leftmargin=1em]\raggedright
\item 1
\item 2
\end{itemize}
&
\begin{itemize}[topsep=0em, partopsep=0em, parsep=0em, itemsep=0em, leftmargin=1em]\raggedright
\item 1
\item 2
\item 3
\item 4
\end{itemize}
\\
\bottomrule
\end{tabular}
\end{document}
Best Answer
By help of tables nesting and use
m
column type from package `array:Used package \paralist
enables simple to define different itemize's label stiles as well adopt left margin of itemize to label width. Of course, if you more familiar with
enumitem` package, the same can be achieved with it.Addendum: If you like to manually centering of first cell's content, that see of the next solution is less over-killed :-). In it is not nested tables, only
minipage
s. Position of first cell content you adjust with maxsimal number of lines in other cells.Result is similar as before. This time I omited vertical lines, which in the first case serve only for show columns width in would be in real use omitted.