I have a tabular which relies on a number of packages to achieve the desired appearance, specifically:
- Scale text to a particular (smaller) size
- Force column wrapping instead of shrinking text further
- Increase space between different rows to distinguish between wrapped items
- Disable right justification and hyphenation for a tidier look
I discovered that the table will end up needing to span multiple pages, but in this situation longtable is not a drop-in replacement for tabular and I am getting confused with the number of packages involved. How can I achieve the desired effect (a tabular spanning multiple pages, with all other visual elements, including the float caption, retained)? As a second question, can what I've written be simplified in some way?
\documentclass{scrartcl}
\usepackage{booktabs,array,parskip,adjustbox,enumitem}
\usepackage[UKenglish]{babel}
\newcolumntype{x}[1]{>{\raggedright}p{#1}}
\begin{document}
\begin{table}
\begin{hyphenrules}{nohyphenation}
\renewcommand{\arraystretch}{1.5}
\caption{Example table}\label{tab:example}
\centering
\begin{adjustbox}{width=1\textwidth}
\begin{tabular}{x{.2\columnwidth}@{\hskip 6\tabcolsep}x{.4\columnwidth}@{\hskip 6\tabcolsep}x{.4\columnwidth}}
\toprule
{\textbf{Column One}} & {\textbf{Column Two}} & {\textbf{Column Three}}
\tabularnewline
\midrule
ABC &
\begin{itemize}[leftmargin=*]
\item This is an item in column two.
\item This is another item in column two.
\end{itemize} &
\begin{itemize}[leftmargin=*]
\item Here is something in column three:
\begin{itemize}
\item It
\item consists
\item of
\item many
\item different
\item lines
\end{itemize}
\end{itemize}
\tabularnewline
DEF &
\begin{itemize}[leftmargin=*]
\item Additional blah blah making for a long sentence spanning multiple lines.
\item Another item.
\item Continuing the theme of items in column two.
\end{itemize} &
\begin{itemize}[leftmargin=*]
\item Here we also have a rather long item that needs multiple lines to fit.
\item Yet another item.
\item Blah, blah:
\begin{itemize}
\item It's a very long example of a sub-item in this column, here
\item Yet more
\end{itemize}
\end{itemize}
\tabularnewline
GHI &
\begin{itemize}[leftmargin=*]
\item Another long, long long long long long long long long long long long
block of text.
\item This particular one is medium-medium medium in lenght.
\item This sentence means nothing in particular, it's blah.
\end{itemize} &
\begin{itemize}[leftmargin=*]
\item Blah
\end{itemize}
\tabularnewline
JKL &
\begin{itemize}[leftmargin=*]
\item Blah, blah, blah, blah, blah.
\item Putting in fake data gets tedious.
\item Reading it is probably more boring still.
\end{itemize} &
\begin{itemize}[leftmargin=*]
\item Blah
\end{itemize}
\tabularnewline
MNO &
\begin{itemize}[leftmargin=*]
\item This was also a really long item so I am going to type and type and
type until I run out of words.
\end{itemize} &
\begin{itemize}[leftmargin=*]
\item Blah
\item Can
\item we
\item span
\item multiple
\item pages
\item with
\item lots
\item of
\item text?
\item Becauase
\item this
\item really
\item needs
\item to
\item be
\item multipage.
\end{itemize}
\tabularnewline
\bottomrule
\end{tabular}
\end{adjustbox}
\renewcommand{\arraystretch}{1}
\end{hyphenrules}
\end{table}
\end{document}
Best Answer
The first page:
The second page:
MWE (in preamble are considered only used packages):