0

This question already has an answer here:

I have a table where some cells contain a bulleted list produced by itemize. I want to present these lists in a compact way. I use the enumitem package and \setlist[itemize]{nosep} (plus other parameters to reduce horizontal space but they're irrelevant here so I didn't include them in my MWE).

I'm still getting unwanted whitespace above and below the list, when it's the sole item in a cell (but not when there's text above/below). How can I get rid of this unwanted vertical space?

I'd like the first line of the list item to be aligned with the first line of a plain text cell in the same row of the table, or close enough.

Not acceptable: merely faking the bullets, because some items are multiline and I do want the indentation. I won't have nested lists, so redoing the bullets and the indentation of subsequent lines without invoking the itemize environment would be ok.

image of MWE

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\setlist[itemize]{nosep,topsep={0pt},partopsep={0pt}}

Too much space before and after \verb`itemize`:

\begin{tabular}{p{5em}p{15em}p{5em}}
  \hline
  wibble \par wobble \par wubble &
  \begin{itemize}
  \item something
  \item something else, which can span multiple lines
  \end{itemize} &
  \begin{itemize}
  \item hello
  \item world
  \item more
  \end{itemize}
  \\ \hline
  wibble \par wobble \par wubble &
  \begin{itemize}
  \item something
  \item something else, which can span multiple lines
  \end{itemize} &
  \begin{itemize}
  \item hello
  \item world
  \item more
  \end{itemize}
  even more
  \\ \hline
\end{tabular}

\bigskip

Approximate desired visual effect:

\begin{tabular}{p{5em}p{15em}p{5em}}
  \hline
  wibble \par wobble \par wubble &
  \vspace{-0.5\baselineskip}
  \begin{itemize}
  \item something
  \item something else, which can span multiple lines
  \end{itemize}
  \vspace{-0.7\baselineskip}
  &
  \vspace{-0.5\baselineskip}
  \begin{itemize}
  \item hello
  \item world
  \item more
  \end{itemize}
  \vspace{-0.7\baselineskip}
  \\ \hline
\end{tabular}
\end{document}

marked as duplicate by egreg lists Sep 10 '15 at 22:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

For example, replace itemize environment by something more understandable:

\def\doitems{\def\item{\par
   \noindent\hbox to1.5em{\hss$\bullet$\hss}\hangindent=1.5em }}

\begin{tabular}{p{5em}p{15em}p{5em}}
  \hline
  wibble \par wobble \par wubble &
  \doitems   
  \item something
  \item something else, which can span multiple lines &
  \doitems 
  \item hello
  \item world
  \item more
  \\ \hline
  wibble \par wobble \par wubble &
  \doitems
  \item something
  \item something else, which can span multiple lines & 
  \doitems
  \item hello
  \item world
  \item more
  \par
  even more
  \\ \hline
\end{tabular}
1

Here are two approaches. One uses a tabular and guarantees that the rows are lined up, and consequently requires a multirow to overlap lines. The other uses minipages and may or may not line up rows (font size change, over sized math expressions, etc.).

\documentclass{article}
\usepackage{multirow}
\parskip=\baselineskip
\begin{document}

\newcommand*{\tabitem}[1]{\hangindent=\bibindent\makebox[\bibindent]{$\bullet$}#1}

\noindent\begin{tabular}{p{5em}p{15em}p{5em}}
  \hline
  wibble & \tabitem{something} & \tabitem{hello} \\
  wobble & \multirow{2}{15em}{\tabitem{something else, which can span multiple lines}} & \tabitem{world} \\
  wubble & & \tabitem{more} \\
  \hline
\end{tabular}


\newcommand*{\paritem}[1]{\parbox[t]{\textwidth}{\raggedright\tabitem{#1}}}

\noindent\rule[.7ex]{\dimexpr 25em + 6\tabcolsep}{0.5pt}\\[-1.5ex]
\hspace*{\tabcolsep}\begin{minipage}[t]{5em}
wibble\\
wobble\\
wubble
\end{minipage}\hspace{2\tabcolsep}\begin{minipage}[t]{15em}
\paritem{something}\\
\paritem{something else, which can span multiple lines}
\end{minipage}\hspace{2\tabcolsep}\begin{minipage}[t]{5em}
\paritem{hello}\\
\paritem{world}\\
\paritem{more}
\end{minipage}\\
\rule[.7ex]{\dimexpr 25em + 6\tabcolsep}{0.5pt}

\end{document}

wibble wobble wubble

Not the answer you're looking for? Browse other questions tagged or ask your own question.