3

I have a long word that describes all the values, so I don't want this big gap between A and B. The gap should be everywhere the same, so the word foooooo should not affect the gap between the values.

How to fix this?

enter image description here

\documentclass{article}
\usepackage{booktabs}
 \begin{document}

\begin{tabular}{@{} *5l @{}}    \toprule
\emph{name} & \emph{fooooooo} &&&  \\\midrule
Models    & A  & B  & C  & D  \\ 
 Model $X$ & X1 & X2 & X3 & X4\\ 
 Model $Y$ & Y1 & Y2 & Y3 & Y4\\\bottomrule
 \hline
\end{tabular}
\end{document}
Joey
  • 227

1 Answers1

3

You can use \multicolumn so the cell for the "fooo" word spans all the other four columns:

\documentclass{article}
\usepackage{booktabs}

\begin{document}

\noindent
\begin{tabular}{@{} *5l @{}}    
\toprule
\emph{name} & \multicolumn{4}{c}{\emph{fooooooo}}\\\midrule
 Models    & A  & B  & C  & D  \\ 
 Model $X$ & X1 & X2 & X3 & X4\\ 
 Model $Y$ & Y1 & Y2 & Y3 & Y4\\
\bottomrule
\end{tabular}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128