4

I have a table which I scale 120% to the width of my text. However, the text within the table is not readable.

Table

Here is reproducable example

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{booktabs}
\usepackage{adjustbox}
\newcommand{\tabitem}{~~\llap{\textbullet}~~}

\begin{document}

\begin{table}[]
\centering
\begin{adjustbox}{width=1.2\textwidth,center=\textwidth}
\begin{tabular}{@{}lll@{}}
\toprule
COLUMN 1 & COLUMN 2 & COLUMN 3 \\ \midrule
\begin{tabular}[c]{@{}l@{}}\tabitem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita\\ \tabitem Lorem ipsum dolor sit\\ \tabitem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor\end{tabular} & \begin{tabular}[c]{@{}l@{}}\tabitem Lorem ipsum dolor sit amet, consetetur sadipscing \\ \tabitem Lorem ipsum dolor sit\tabitem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor\\ \tabitem Lorem ipsum\end{tabular} & \begin{tabular}[c]{@{}l@{}}\tabitem Lorem ipsum\\ \tabitem Lorem ipsum\end{tabular} \\
\begin{tabular}[c]{@{}l@{}}\tabitem Lorem ipsum dolor sit amet, consetetur sadipscing \\ \tabitem Lorem ipsum dolor sit\tabitem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor\end{tabular} & \begin{tabular}[c]{@{}l@{}}\tabitem Lorem ipsum dolor sit amet, consetetur sadipscing\\ \tabitem Lorem ipsum dolor sit\\ \tabitem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor\\ \tabitem Lorem ipsum\\ \tabitem Lorem ipsum\end{tabular} & \begin{tabular}[c]{@{}l@{}}\tabitem Lorem ipsum\\ \tabitem Lorem ipsum\end{tabular} \\ \bottomrule
\end{tabular}
\end{adjustbox}
\caption{My caption}
\label{my-label}
\end{table}

\end{document}

What I want is that the text in the table hast the same size as the text in the document. Inserting \normalsize after \begin{table}[] did nothing.

6

I suggest you load (a) the tabularx package to allow automatic line-wrapping and (b) the enumitem package to create compact itemized environments. I would also like to suggest that the material in the three columns be typeset raggedright rather than fully-justified.

Incidentally, I've assumed that you want the three columns to have equal widths. If this is not the case, do let me know.

enter image description here

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{booktabs,tabularx,ragged2e}
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}
\usepackage{enumitem}

\begin{document}

\begin{table}
\begin{tabularx}{\textwidth}{@{} LLL @{}}
\toprule
COLUMN 1 & COLUMN 2 & COLUMN 3 \\ 
\midrule
\begin{itemize}[nosep,wide]
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{itemize} & 
\begin{itemize}[nosep,wide]
    \item Lorem ipsum dolor sit amet, consetetur sadipscing
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
    \item Lorem ipsum
\end{itemize} & 
\begin{itemize}[nosep,wide]
    \item Lorem ipsum
    \item Lorem ipsum
\end{itemize} \\
\begin{itemize}[nosep,wide]
    \item Lorem ipsum dolor sit amet, consetetur sadipscing  
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{itemize} & 
\begin{itemize}[nosep,wide]
    \item Lorem ipsum dolor sit amet, consetetur sadipscing 
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
    \item Lorem ipsum
    \item Lorem ipsum
\end{itemize} & 
\begin{itemize}[nosep,wide]
    \item Lorem ipsum
    \item Lorem ipsum
\end{itemize} \\ 
\bottomrule
\end{tabularx}
\caption{My caption}
\label{my-label}
\end{table}

\end{document}

Addendum to address the OP's follow-up question: If the three columns aren't supposed to be equally wide, I suggest you use a setup similar to the one provided in the following example. Here, I've replaced the tabularx environment with a tabular* environment, with an overall width still set to \textwidth. The tabular* environment is set up with three (modified) p-type columns; the argument is the fractional width of the column. E.g., p{0.35} means, "a p-type column of width 0.35\textwidth. All you to do is assure that the three fractional widths sum to a number slightly less than 1. In the example below, the three widths sum to 0.96\textwidth; thus, each of the two intercolumn whitespaces has width 0.02\textwidth. Observe that the example also features a bespoke itemized list environment, called mylist, defined with the help of the enumitem package.

enter image description here

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{booktabs,array,ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1\textwidth}}

\usepackage{enumitem}
%% Create a very compact itemized list environment
\newlist{mylist}{itemize}{1}
\setlist[mylist]{label=\textbullet, nosep, wide, 
                 leftmargin=*, % for hanging indentation
                 before=\vspace{-0.50\baselineskip},
                 after =\vspace{-0.8\baselineskip}}
\begin{document}

\begin{table}
\setlength\tabcolsep{0pt} % <--- important
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} 
    P{0.38}P{0.38}P{0.2}} %% 0.38+0.38+0.2 = 0.96 < 1!
\toprule
Column 1 & Column 2 & Column 3 \\ 
\midrule
\begin{mylist}
     \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
    \item Lorem ipsum
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} \\
\addlinespace % or: \midrule
\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing  
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing 
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} \\ 
\bottomrule
\end{tabular*}
\caption{My caption}
\label{my-label}
\end{table}
\end{document}

Second addendum, to address the OP's request how the preceding table might be (re)created as a longtable. Here goes. No separate screenshot is posted, as it would virtually identical (by design, obviously) to the preceding screenshot.

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{booktabs,array,ragged2e,longtable}
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1\textwidth}}

\usepackage{enumitem}
%% Create a very compact itemized list environment
\newlist{mylist}{itemize}{1}
\setlist[mylist]{label=\textbullet, nosep, wide, 
                 leftmargin=*, % hanging indentation
                 before=\vspace{-0.50\baselineskip},
                 after =\vspace{-0.8\baselineskip}}
\begin{document}

% keep scope of longtable-related instructions local to current TeX group
\begingroup 
\setlength\tabcolsep{0pt} % <--- important
\setlength\LTleft{0pt}
\setlength\LTright{0pt}

\begin{longtable}{@{\extracolsep{\fill}}P{0.38}P{0.38}P{0.2}}

\caption{My caption} \label{my-label}\\ 
\toprule
Column 1 & Column 2 & Column 3 \\ 
\midrule
\endfirsthead

\multicolumn{3}{l}{(Table \ref{my-label}, cont'd)}\\ % re-state table number
\addlinespace
\toprule
Column 1 & Column 2 & Column 3 \\ 
\midrule
\endhead

\bottomrule
\addlinespace
\multicolumn{3}{r}{(cont'd on next page)}\\
\endfoot

\bottomrule
\endlastfoot

\begin{mylist}
     \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
    \item Lorem ipsum
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} \\

\addlinespace

\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing  
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing 
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} \\ 

\addlinespace

\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing  
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing 
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} \\ 

\addlinespace

\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing  
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing 
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} \\ 

%\addlinespace % omit if at page break

\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing  
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum dolor sit amet, consetetur sadipscing 
    \item Lorem ipsum dolor sit
    \item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} & 
\begin{mylist}
    \item Lorem ipsum
    \item Lorem ipsum
\end{mylist} \\ 

\end{longtable}
\endgroup % end of TeX group that encases the 'longtable' material

\end{document}

  • Awesome, thanks. That does everything automatically. How would I go on if I dont want every column the same width? I might need to play around a little. – Stophface Feb 8 '18 at 16:11
  • @Stophface - Please see the addendum I just posted to address your follow-up question. – Mico Feb 8 '18 at 19:01
  • Is there any chance you could expand the last example on how to stretch the table over more than one page? That drives me nuts... – Stophface Feb 9 '18 at 11:34
  • @Stophface - Just remove the table wrapper and change tabular* to longtable. I'll post some minimal code. Do note that with multi-page tables, the caption is almost invariably displayed at the start rather than at the end of the tabular material. – Mico Feb 9 '18 at 12:03
  • Awesome Mico. Thank you very very much! Bummer that the caption won't go under the table though. – Stophface Feb 9 '18 at 12:45
3

If you want it to be readable, you need to trade width for height.

Note: \\ changes definitions depending on the environment. In a tabular it is used to end a row, so use \newline or \par inside a \parbox.

\usepackage{booktabs}
\usepackage{adjustbox}
\newcommand{\tabitem}{\par\makebox[1em]{\textbullet}}

\begin{document}

\begin{table}[]
\centering
\begin{tabular}{@{}p{.3\textwidth}p{.3\textwidth}p{.3\textwidth}@{}}
\toprule
COLUMN 1 & COLUMN 2 & COLUMN 3
 \\ \midrule
\tabitem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita  \tabitem Lorem ipsum dolor sit \tabitem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
 & \tabitem Lorem ipsum dolor sit amet, consetetur sadipscing  \tabitem Lorem ipsum dolor sit \tabitem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor \tabitem Lorem ipsum
 & \tabitem Lorem ipsum \tabitem Lorem ipsum
 \\
\tabitem Lorem ipsum dolor sit amet, consetetur sadipscing  \tabitem Lorem ipsum dolor sit\tabitem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
 & \tabitem Lorem ipsum dolor sit amet, consetetur sadipscing \tabitem Lorem ipsum dolor sit \tabitem Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor \tabitem Lorem ipsum \tabitem Lorem ipsum
 & \tabitem Lorem ipsum \tabitem Lorem ipsum
 \\ \bottomrule
\end{tabular}
\caption{My caption}
\label{my-label}
\end{table}

demo

  • So there is no way to tell latex to scale the table automatically? – Stophface Feb 8 '18 at 16:09
  • The p{\.3\textwidth} column is equivalent to a \parbox{.3\textwidth}{...} in each row. Parboxes and minipages both allow line breaking, but you have to tell it how wide. Scaling often results in unreadable tables and should be avoided. – John Kormylo Feb 8 '18 at 16:11
3

Of course your text shall be unreadable since its natural width is much wider than the page. I propose a solution with a new column type, based on tabularx which includes automatically entering and leaving an itemize environment on entering and leaving a cell. It also requires enumitem:

\documentclass[english]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[showframe]{geometry} 
\usepackage{babel}
\usepackage{booktabs, tabularx, makecell}
\usepackage{enumitem}

    \makeatletter
    \newcommand*{\compress}{\@minipagetrue}
    \makeatother
      \newcolumntype{L}{>{\compress\itemize}X<{\enditemize}}

\begin{document}

\begin{table}[!htb]
\centering
\setlist[itemize]{wide = 0pt, nosep, leftmargin = *, after = \vspace*{\dimexpr-\baselineskip + 1.5ex}}
%\begin{adjustbox}{width=1.2\textwidth,center=\textwidth}
\begin{tabularx}{\linewidth}{@{}LLL@{}}
\toprule
\multicolumn{1}{c}{COLUMN 1} & \multicolumn{1}{c}{COLUMN 2} & \multicolumn{1}{c}{COLUMN 3} \\ \midrule
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita 
\item Lorem ipsum dolor sit 
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor %
& \item Lorem ipsum dolor sit amet, consetetur sadipscing 
\item Lorem ipsum dolor sit 
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 
 \item Lorem ipsum
 & \item Lorem ipsum 
  \item Lorem ipsum \\
\item Lorem ipsum dolor sit amet, consetetur sadipscing 
\item Lorem ipsum dolor sit 
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
& \item Lorem ipsum dolor sit amet, consetetur sadipscing 
\item Lorem ipsum dolor sit 
\item Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor 
\item Lorem ipsum 
\item Lorem ipsum
& \item Lorem ipsum 
\item Lorem ipsum \\
\bottomrule
\end{tabularx}
%\end{adjustbox}
\caption{My caption}
\label{my-label}
\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.