0

I have the following table: enter image description here

I want the following: 'Short-crested' belongs to the value 1, 2, 5, 10 and 20. 'Long-crested' belongs to the value 100, 200, 500, 1000, 10000. I want them to move to above the corresponding values. So that means 'Short-crested' and 'Long-crested' should move to the right. Also, I want to omit the large spacing between 5 - 10 and c - d.

I did the following:

\begin{table}[H] 
\caption{Some table} \label{table1}
\begin{tabular}{ p{3.5cm}| p{0.55cm} p{0.55cm} p{0.55cm} p{0.55cm} p{0.55cm} p{0.55cm} p{0.55cm} p{.55cm} p{0.55cm} p{0.55cm}}
\toprule
\multicolumn{2}{c}{Short-crested} & \multicolumn{2}{c}{Long-crested}\\
\hline
Spreading $s$ & 1  & 2 & 5 & 10 & 20 &100 & 200 & 500& 1000 & 10000\\
Period $T_{mean}$   & a  & b & c & d & e & f & g & h & i & j \\
\bottomrule
\end{tabular}
\end{table} 

What is going wrong here?

2
  • 1
    Syntax of command \multicolumn{nbr_of_columns}{c}{text}.
    – Salim Bou
    Jul 4, 2016 at 15:17
  • Well, you made a bunch of p{0.55cm} -- that's the distance you see
    – user31729
    Jul 4, 2016 at 15:21

1 Answer 1

1

You need to place your multicolumn to the right place:

\begin{table}[htb] 
    \caption{Some table} 
    \label{table1}
\begin{tabular}{ p{3.5cm}| *{10}{p{0.55cm} }
\toprule
    & \multicolumn{4}{c}{Short-crested} & \multicolumn{6}{c}{Long-crested}\\
\hline
Spreading $s$       & 1  & 2 & 5 & 10 & 20 &100 & 200 & 500& 1000 & 10000\\
Period $T_{mean}$   & a  & b & c & d & e & f & g & h & i & j \\
\bottomrule
\end{tabular}

\end{table}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .