2

I am trying to create a table with a sideways row name in one cell and an itemize list in the adjacent cell. When I try this, the row name winds up above the itemized list rather than next to it.

Here is a minimum working example:

\documentclass{article}
\usepackage{rotating}
\begin{document}
\begin{tabular}{| p{0.1\textwidth} | p{0.5\textwidth} |}
\hline
\begin{sideways}\parbox{1in}{\centering Row\\Title}\end{sideways} &
\begin{itemize}
\item Item 1
\item Item 2
\item Item 3
\end{itemize}\\
\hline
\end{tabular}
\end{document}

And here is the output it produces:

MWE

Notes:

  • I'm using \parbox because I want to have a multi-line row name. This is the only solution I've gotten to work so far within the sideways environment, but I'm open to alternatives, especially any that would scale automatically with the row height without needing to specify it (as I have in this example).
  • Likewise, I'm using p columns in tabular to control column width, but would gladly switch to another type that would fix this vertical alignment problem while also allowing me to control column width.

1 Answer 1

3

Welcome to TeX.SE!

By use of the tabularray package and help of rotating (for rotating), makecell (for \rotcell and \rotheadsize command), ęnumitem (for list formatting) packages, the MWE (Minimal Working Example) is simple:

\documentclass{article}
\usepackage{rotating}
\usepackage{makecell}
\usepackage{tabularray}
\usepackage{enumitem}

\begin{document}
\begin{tblr}{hlines, vlines,
              colspec = {Q[c, cmd = \settowidth\rotheadsize{Title}\rotcell] 
                         Q[h, wd=0.5\textwidth]},
              stretch = -1,  % remove space above lists
            }
{Row\\Title}    &   \begin{itemize}[nosep, leftmargin=*]  % formatting itemize
                \item Item 1
                \item Item 2
                \item Item 3
                    \end{itemize}\\
\end{tblr}
\end{document}

enter image description here

You must log in to answer this question.

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