0

I am making a large table for the appendix of my paper, only I have problems with overlapping columns. I have checked multiple posts however the solutions did not help to solve my problem. I hope you have any suggestions to fix it.

I make use of the following code:

\begin{table}[]
\centering
\footnotesize
\caption{My caption}
\label{my-label}
\rotatebox{90}{
\begin{tabular}{p{4cm}|p{4cm}|p{4cm}|p{4cm}|p{4cm}}
\hline
{\color[HTML]{000000} \textbf{Target group}}                                   & \textbf{First approach}                                                                           & \textbf{Second approach}                                                                                                                     & \textbf{Third approach}                                                                                       & \textbf{Fourth approach}                                                                                                                                         \\ \hline
\textbf{Rotterdam}                                                             &                                                                                                   &                                                                                                                                              &                                                                                                               &                                                                                                                                                                  \\
{\color[HTML]{000000} 17-24 year}                                              & \begin{tabular}[c]{@{}l@{}}Letter in ‘jij-vorm’ with login code for digital\\ survey\end{tabular} & Letter with login code digital survey and paper survey                                                                                       & Reminder letter with login code for digital survey                                                            & Reminder card (only the men)                                                                                                                                     \\
24-65 year                                                                     & Letter with login code for digital survey                                                         & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & Reminder letter with login code for digital survey                                                            & \begin{tabular}[c]{@{}l@{}}Reminder card (only the men of 24-35 year). \\ In the 6 target districts unannounced\\ telephone interviews (35-65 year)\end{tabular} \\
65+                                                                            & Letter with login code for digital survey                                                         & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & \begin{tabular}[c]{@{}l@{}}Reminder letter with login code for digital survey and\\ paper survey\end{tabular} & \begin{tabular}[c]{@{}l@{}}In the 6 target districts unannounced\\ telephone interviews\end{tabular}                                                             \\
\begin{tabular}[c]{@{}l@{}}Turks 1st generation\\ 24-65 year\end{tabular}      & \begin{tabular}[c]{@{}l@{}}Letter NL and Turks with login code for digital\\ survey\end{tabular}  & Letter NL and Turkish with login,code digital survey and paper survey NL and,Turkish translation                                             & \begin{tabular}[c]{@{}l@{}}Reminder letter NL and Turks with login code for digital\\ survey\end{tabular}     & \begin{tabular}[c]{@{}l@{}}Invitation for telephone\\ interview or interview at home\end{tabular}                                                                \\
\begin{tabular}[c]{@{}l@{}}Turks 1st generation\\ 65+\end{tabular}             & Letter NL and Turks with login code for digital survey                                            & \begin{tabular}[c]{@{}l@{}}Letter NL and Turkish with login code digital survey and\\ paper survey NL and Turkish\\ translation\end{tabular} & \begin{tabular}[c]{@{}l@{}}Letter NL and Turks with login code for digital\\ survey\end{tabular}              & \begin{tabular}[c]{@{}l@{}}Invitation for telephone\\ interview or interview at home\end{tabular}                                                                \\
Moroccans 1st generation 24-65 year                                            & \begin{tabular}[c]{@{}l@{}}Letter NL and Arabic with login code for digital\\ survey\end{tabular} & \begin{tabular}[c]{@{}l@{}}Letter NL and Arabic with login code digital survey and\\ paper survey\end{tabular}                               & \begin{tabular}[c]{@{}l@{}}Invitation for telephone\\ interview or interview at home\end{tabular}             &                                                                                                                                                                  \\
Moroccans 1st,generation 65+                                                   & \begin{tabular}[c]{@{}l@{}}Letter NL and Arabic with login code for digital\\ survey\end{tabular} & \begin{tabular}[c]{@{}l@{}}Letter NL and Arabic with login code digital survey and\\ paper survey\end{tabular}                               & \begin{tabular}[c]{@{}l@{}}Invitation for telephone interview\\ or interview at home\end{tabular}             &                                                                                                                                                                  \\
\begin{tabular}[c]{@{}l@{}}Surinamers 1st\\ generation 24-65 year\end{tabular} & Letter with login code for digital survey                                                         & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & \begin{tabular}[c]{@{}l@{}}Invitation for telephone interview\\ or interview at home\end{tabular}             &                                                                                                                                                                  \\
Surinamers 1st,generation 65+                                                  & Letter with login code for digital survey                                                         & Letter with login code digital survey and paper survey                                                                                       & \begin{tabular}[c]{@{}l@{}}Invitation for telephone interview\\ or interview at home\end{tabular}             &                                                                                                                                                                  \\
\textbf{Region Rijnmond excluding Rotterdam}                                   &                                                                                                   &                                                                                                                                              &                                                                                                               &                                                                                                                                                                  \\
17-24 year                                                                     & \begin{tabular}[c]{@{}l@{}}Letter in ‘jij-vorm’ with login code for digital\\ survey\end{tabular} & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & Reminder letter with login code for digital survey                                                            &                                                                                                                                                                  \\
24-65 year                                                                     & Letter with login code for digital survey                                                         & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & Reminder letter with login code for digital survey                                                            &                                                                                                                                                                  \\
65+                                                                            & Letter with login code for digital survey                                                         & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & \begin{tabular}[c]{@{}l@{}}Reminder letter with login code for digital survey and\\ paper survey\end{tabular} &                                                                                                                                                                  \\ \hline
\end{tabular}}
\end{table}

Which gives the following problem:

enter image description here

Help would be very appreciated!

3

Here is a solution. It's simpler to use the sidewaystable* environment and tabularx. I removed the vertical lines, replaced \hlines with the rules from booktabs, which have some vertical padding around them, and used some commands from makecell. Furthermore, as most cell contents are repetitive, I introduced some macros to simplify typing them:

\documentclass[a4paper, twocolumn]{article}%
\usepackage[utf8]{inputenc}%
\usepackage[T1]{fontenc}%
\usepackage{lmodern}%
\usepackage{array, tabularx, caption, booktabs, makecell}%
\usepackage[a4paper]{geometry} %
\usepackage{amsmath}%
\usepackage{rotating}%
\usepackage[table]{xcolor}%
\usepackage{ragged2e}%
\newcommand\nl{\newline}%
%% some abbreviations%
\def\interview{Invitation for telephone interview or interview at home}%
\newcommand\DS[1][]{Letter #1 with login code for digital survey}%
\newcommand\DSP[1][]{Letter #1 with login code digital survey and paper survey}%
\newcommand\RDS[1][]{Reminder letter #1 with login code for digital survey}%
\newcommand\RDSP[1][]{Reminder letter #1 with login code for digital survey and paper survey}%

\begin{document}%


\begin{sidewaystable*}%
  \footnotesize
  \setlength\tabcolsep{4pt}
  \setcellgapes{1ex}\makegapedcells
  \renewcommand\theadfont{\bfseries}
  \renewcommand\theadalign{lc}%
  \caption{My caption} \label{my-label}
  \begin{tabularx}{\linewidth}{l*{4}{ >{\RaggedRight\arraybackslash}X}}
    \toprule
    \thead{Target group} & \thead{First approach} & \thead{Second approach} & \thead{Third approach} & \thead{Fourth approach} \\%
    \midrule%
    \textbf{Rotterdam} \\%
    {17--24 year} & \DS[in ‘jij-vorm’] & \DSP & \RDS & Reminder card (only the men) \\%
    24--65 year & \DS & \DSP & \RDS & Reminder card (only the men of 24-35 year). In the 6 target districts unannounced telephone interviews (35--65 year) \\
    65\,$ + $ & \DS & \DSP & \RDSP & In the 6 target districts unannounced telephone interviews \\
    \makecell[tl]{Turks 1st generation & & & & \\ 24--65 year} & \DS[NL and Turks] & \DSP[NL and Turkish] NL and Turkish translation & \RDS[NL and Turks] & \interview \\
    \makecell[tl]{Turks 1st generation & & & & \\ 65\,$ + $} & \DS[NL and Turks] & \DSP[NL and Turkish] NL and Turkish translation & \DS[NL and Turks] & \interview \\
    \makecell[tl]{Moroccans 1st generation & & & & \\ 24--65 year} & \DS[NL and Arabic] & \DSP[NL and Arabic] & \interview & \\%
    \makecell[tl]{Moroccans 1st generation & & & & \\ 65\,$ + $} & \DS[NL and Arabic] & \DSP[NL and Arabic] & \interview & \\
    \makecell[tl]{Surinamers 1st generation & & & & \\ 24--65 year} & \DS & \DSP & \interview & \\
    \makecell[tl]{Surinamers 1st generation & & & & \\ 65\,$ + $} & \DS & \DSP & \interview & \\
    \addlinespace[3ex]
    \multicolumn{5}{l}{\textbf{Region Rijnmond excluding Rotterdam}} \\
    17--24 year & \DS[in ‘jij-vorm’] & \DSP & \RDS & \\
    24--65 year & \DS & \DSP & \RDS & \\
    65\,+ & \DS & \DSP & \RDSP & \\
    \bottomrule
  \end{tabularx}%
\end{sidewaystable*}

\end{document} 

enter image description here

  • This looks exactly how I wanted, thanks @Bernard! I only have two errors occurring when I do use the code in my own file. \usepackage{ragged2e}? and \end{tabularx}?. Is this because I need to download a file on my computer for ragged2e? Sorry for asking, but them I know I am on the right track – Keizer Jul 18 '16 at 14:55
  • Which distribution do you have? For tabularx, what is the exact error message? – Bernard Jul 18 '16 at 15:00
  • This is the exact error message LaTex Error: Option clash for package color. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. … l.52 \usepackage {ragged2e%} ? and I use documentclass[a4paper,11pt]{article}, don't now if this makes it different – Keizer Jul 18 '16 at 15:18
  • That's a minor error. You've loaded xcolor twice, and once with option [table]. Load it only once, preferably with the option (it loads colortbl then, useful if you want to colour some tables). For ragged2e, it's probably not installed on your system. Install it with your package manager. Are you under MiKTeX? – Bernard Jul 18 '16 at 15:23
  • Great! No, never used it consciously. However, so far I am not able to download ragged2e on tex live, it is probably my mistake since I am quite new to R and not really handy with these things. Is there another way then using miktex or tex live to download ragged2e? – Keizer Jul 18 '16 at 16:15

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.