0

I am trying to create a table with an unordered list in the last column. The problem with the code below is that it skips a line in each cell in that column just like the figure below. How can I create the table without having that skipped line?

Output

\documentclass{article}

\usepackage[margin=2.3cm]{geometry}
\begin{document}



\centering

{\renewcommand{\arraystretch}{2}

\begin{tabular}{ p{35mm} p{20mm} p{20mm} p{20mm} p{25mm} p{45mm}} 
 \hline
 & \centering Column \newline Number 2 & \centering Column \newline Number 3  & \centering Column \newline Number 4  & \centering Column \newline Number 5 & Column \newline Number 6  \\ 
 \hline

 entry1 & \centering entry2 & \centering entry3 & \centering entry4 & \centering entry5 &  \begin{itemize} \item entry6.1 \item  entry6.2 \end{itemize} \\ 

 entry1 & \centering entry2 & \centering entry3 & \centering entry4 & \centering entry5 &  \begin{itemize} \item entry6.1 \item  entry6.2 \end{itemize} \\  

 \hline
\end{tabular}

\end{document}
1

Some improvements and simplification (from a code by @Stefan Kottwitz):

\documentclass{article}

\usepackage[margin=2.3cm]{geometry}
\usepackage{enumitem, etoolbox, tabularx, makecell, booktabs}
\makeatletter
\newcommand*{\compress}{\@minipagetrue}
\makeatother

\begin{document}



\centering

{\renewcommand{\arraystretch}{2}
\setlist[itemize]{wide=0pt, leftmargin=*, topsep=0pt, after=\vspace*{-\baselineskip}}
\AtBeginEnvironment{itemize}{\compress}
\begin{tabularx}{\linewidth}{X *{3}{p{20mm}} p{25mm}p{45mm}}
 \toprule
 & \thead{Column \\ Number 2} & \thead{Column \\ Number 3} & \thead{Column \\ Number 4} & \thead{Column \\ Number 5} & \thead{Column \\ Number 6} \\
 \midrule

 entry1 & \centering entry2 & \centering entry3 & \centering entry4 & \centering entry5 & \begin{itemize} \item entry6.1 \item entry6.2 \end{itemize}
  \\

 entry1 & \centering entry2 & \centering entry3 & \centering entry4 & \centering entry5 &\begin{itemize} \item entry6.1 \item entry6.2 \end{itemize} \\

 \bottomrule
\end{tabularx}}

\end{document} 

enter image description here

2
\documentclass{article}

\usepackage[margin=2.3cm]{geometry}
\begin{document}



\centering

{\renewcommand{\arraystretch}{2}

\begin{tabular}{ p{35mm} p{20mm} p{20mm} p{20mm} p{25mm} p{45mm}}
 \hline
 & \centering Column \newline Number 2 & \centering Column \newline Number 3  & \centering Column \newline Number 4  & \centering Column \newline Number 5 & Column \newline Number 6  \\
 \hline

 entry1 & \centering entry2 & \centering entry3 & \centering entry4 & \centering entry5 &  \makeatletter\@minipagetrue\begin{itemize} \item entry6.1 \item  entry6.2 \end{itemize} \\

 entry1 & \centering entry2 & \centering entry3 & \centering entry4 & \centering entry5 &  \makeatletter\@minipagetrue\begin{itemize} \item entry6.1 \item  entry6.2 \end{itemize} \\

 \hline
\end{tabular}}

\end{document}

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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