Remove space above `itemize` list within table environment
- If you use the
compactitem
environment, you need to encase it in\begin{minipage}[t]{\hsize}
and\end{minipage}
statements. If you use an
itemize
environment along with theenumitem
package, you can add the statementsbefore={\begin{minipage}[t]{\hsize}}, after ={\end{minipage}}
to the list of options that go with
\begin{itemize}
.
\documentclass[12pt]{scrbook}
\usepackage{paralist,enumitem,tabularx}
\begin{document}
\begin{table}[ht!]
\setlength\extrarowheight{2pt} % optional, for a slighly more open "look"
\setlength{\leftmargini}{7pt}
\begin{tabularx}{\linewidth}{l | X | X }
\hline \hline
& ECB & FED\\
\hline
M1 & \begin{itemize}[nosep, left=0pt,
before={\begin{minipage}[t]{\hsize}},
after ={\end{minipage}} ]
\item point1
\item point2
\end{itemize}
& \begin{minipage}[t]{\hsize}
\begin{compactitem}
\item point1
\item point2
\end{compactitem}
\end{minipage}\\
\hline
\end{tabularx}
\end{table}
\end{document}
For the space above, it is enough to make LaTeX believe the cell is a minipage. For this, I borrowed a \compress
command found in an answer to a question on this site. For the space below, you have to add a negative \baselineskip at the end.
\documentclass[12pt]{scrbook}
%\usepackage[autooneside=false, headsepline, plainheadsepline, automark]{scrlayer-scrpage}
\linespread{1}
\usepackage{paralist}
\usepackage{enumitem} % enumerate?
\usepackage{tabularx}
\makeatletter
\newcommand{\compress}{\@minipagetrue}
\makeatother
\begin{document}
some text
\begin{compactitem} \item point1 \item point2 \end{compactitem}
\begin{table}[ht!]
\setlength{\leftmargini}{7pt}
\begin{tabularx}{\linewidth}{l | >{\compress}X |>{\compress} X }\hline \hline
& ECB& FED\\ \hline
M1 & \begin{itemize}[nosep, after=\vspace{-\baselineskip}] \item point1 \item point2 \end{itemize}\\
\hline
& & \begin{compactitem} \item point1 \item point2 \end{compactitem}\leavevmode\vspace*{-\baselineskip}
\\
\hline
\end{tabularx}
\end{table}
\end{document}