1

I would like to reproduce the following table in LaTeX:

Figure-1

I decided to use tabularx and minipage environments. MWE goes as follows:

\documentclass{article}
\usepackage{tabularx}
\begin{document}
\begin{table}
\centering
\noindent
\begin{tabularx}{\textwidth}{p{15mm}|p{30mm}|p{3mm}|X@{}}
\hline
Row 1
&
\begin{minipage}[t]{\hsize}
\begin{itemize}
\item item text foo bla zoo
\item item text foo bla zoo
\end{itemize}
\end{minipage}
&
\begin{minipage}[t]{\hsize}
\begin{itemize}
\item item text foo bla zoo
\item item text foo bla zoo
\end{itemize}
\end{minipage}
\\
\hline
Row 2
&
\begin{minipage}[t]{\hsize}
\begin{itemize}
\item item text foo bla zoo
\item item text foo bla zoo
\end{itemize}
\end{minipage}
&
\begin{minipage}[t]{\hsize}
\begin{itemize}
\item item text foo bla zoo
\item item text foo bla zoo
\end{itemize}
\end{minipage}
\\
\hline
\end{tabularx}
\end{table}
\end{document}

But the result is ugly:

  • there is very small space between middle horizontal line and first item in the second row
  • all horizontal lines are extended over the body of the table

Any pointers or advises are greatly appreciated.

Figure-2

1
  • You manually specified the size of the columns, in \begin{tabularx}{\textwidth}{p{15mm}|p{30mm}|p{3mm}|X@{}}. Just increase those sizes, which should give enough space for text to expand.
    – Alex
    Oct 31 '17 at 18:46
2

First, you needn't use minipages for this, and you have only three columns but the table setup includes four, I removed that p{3mm}. Second, itemize environments inside tabulars need special settings, so I suggest loading enumitem and defining a newlist with custom settings to be used only inside tabulars. See below how this can be done.

\documentclass{article}
\usepackage{tabularx}
\usepackage{enumitem}
\newlist{tabitemize}{itemize}{1}
\setlist[tabitemize]{label=\textbullet,leftmargin=*,topsep=0ex,parsep=0pt,
                  after=\vspace{-\baselineskip},before=\vspace{-0.75\baselineskip}}    
\begin{document}

\begin{table}
\centering
\begin{tabularx}{\textwidth}{|p{15mm}|p{30mm}|X@{}|}
\hline
  & column 1 &  column 2 \\ \hline 
Row 1
&
\begin{tabitemize}
\item item text foo bla zoo
\item item text foo bla zoo
\end{tabitemize}
&
\begin{tabitemize}
\item item text foo bla zoo
\item item text foo bla zoo
\end{tabitemize} \\ \hline
Row 2
&
\begin{tabitemize}
\item item text foo bla zoo
\item item text foo bla zoo
\end{tabitemize}
&
\begin{tabitemize}
\item item text foo bla zoo
\item item text foo bla zoo
\end{tabitemize} \\ \hline
\end{tabularx}
\end{table}
\end{document}

enter image description here

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.