1

I have the following table:

enter image description here

created with the following code:

\begin{table}[htb]
\scriptsize 
\centering
\begin{tabular}{b{0.18\linewidth}|b{0.05\linewidth}|b{0.2\linewidth}|b{0.2\linewidth}|b{0.2\linewidth}}
\toprule
\multicolumn{1}{M}{Interviewee} & \multicolumn{1}{M}{Party} & \multicolumn{1}{M}{Date} & \multicolumn{1}{M}{Position} & \multicolumn{1}{M}{Interviewer}  \\ 
\cmidrule(r){1-1} \cmidrule(r){2-2} \cmidrule(r){3-3} \cmidrule(r){4-4}  \cmidrule(r){5-5} 
Ana Gomes & PS & December 6, 2013  & MEP since 2004 & Teste \\
\bottomrule
\end{tabular}
\end{table}

My problem is that I want to make the second column with a smaller width. I'm setting 0.05\linewidth to define the width but for some reason it doesn't go bellow 0.1\linewidth

  • Please tell us how the M column type is set up. – Mico May 22 '18 at 11:10
  • Ah, sorry. I completely forgot I had column type. It is set as \newcolumntype{M}{>{\scriptsize\arraybackslash}p{2.2cm}} . – Miguel May 22 '18 at 11:15
  • 1
    You wrote, "I want to [reduce the width of] the second column..." Since you're assigning a fixed width of 2.2cm to all column header cells, the width of the 2nd column can't be less than 2.2cm. – Mico May 22 '18 at 11:21
  • 1
    why are you using fixed widths at all, rather than simply l ? – David Carlisle May 22 '18 at 11:31
1

I suggest you use a tabularx environment, with its width set to \textwidth, and that you use the l column type for the second column. That way, the 2nd column will have minimum width. Use a modified form of the X column for the other 4 columns.

enter image description here

\documentclass{article}
\usepackage{booktabs,tabularx,ragged2e}
\renewcommand{\tabularxcolumn}[1]{b{#1}} % to emulate the OP's setup
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}

\begin{document}
\begin{table}[htb]
\footnotesize
\begin{tabularx}{\textwidth}{@{} Y l YYY @{}}
\toprule
Interviewee & Party & Date & Position & Interviewer  \\
\midrule
Ana Gomes & PS & December 6, 2013  & MEP since 2004 & Teste \\
\bottomrule
\end{tabularx}
\end{table}
\end{document} 

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.