I'm having a spacing issue in longtable
, where the use of multicolumn
elongates the last column. Example posted below.
The solution suggested to this question does not appear to work for me (\fill
threw up an error), but I suspect the issue is similar.
\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\usepackage{longtable}
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}b{#1}}
\begin{document}
\begin{center}
\begin{longtable}{@{\extracolsep{6pt}}*{5}{L{1.75cm}}}
\toprule\multicolumn{3}{l}{\textbf{Survey Code}} & \multicolumn{2}{r}{\textbf{Month/Year (Sample Size)}} \\ \midrule
\endfirsthead
\multicolumn{5}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\toprule\multicolumn{1}{l}{\textbf{Survey Code}} & \multicolumn{4}{r}{\textbf{Month/Year (Sample Size)}} \\ \midrule
\endhead
\midrule\multicolumn{5}{l}{{Continued on next page}} \\\bottomrule
\endfoot
\bottomrule
\endlastfoot
\multicolumn{3}{l}{Polling Organization} & \multicolumn{2}{r}{(Mo./Yr.) ($N=XXXX$)} \\[1em]
\multicolumn{5}{p{\textwidth}}{\footnotesize \emph{Survey question text goes here.}} \\[1em]
\\[.25em]
\multicolumn{1}{L{2cm}}{Response 1} & \multicolumn{1}{L{2cm}}{Response 2} & \multicolumn{1}{L{2cm}}{Response 3} & \multicolumn{1}{L{2cm}}{Response 4} & \multicolumn{1}{L{2cm}}{Response 5}\\\cmidrule{1-1}\cmidrule{2-2}\cmidrule{3-3}\cmidrule{4-4}\cmidrule{5-5}
\nopagebreak
\multicolumn{1}{p{2cm}}{20\%} & \multicolumn{1}{p{2cm}}{56\%} & \multicolumn{1}{p{2cm}}{6\%} & \multicolumn{1}{p{2cm}}{8\%} & \multicolumn{1}{p{2cm}}{10\%} \\[2em]
\end{longtable}
\end{center}
\end{document}
tabular
environment. Can you add some more rows, that we can see size of numbers in columns.