0

I want to make a table like the image below, such that all the the highlighted cells are merged separately . target The following code produces this:enter image description here

I need to remove parts highlighted by red.

\begin{tabular}{  l  l  l  l  l  l  l  l  l  l  l  l  }
 \hline
 & parameter 1 &  &  &  &  & parameters 2 &  &  &  &  &  \\ \hline
 & d1 & d2 & d3 & d4 &  & d5 & d6 & d7 & d8 & d9 & d10 \\ 
a0 & a1 & a2 & a3 & a4 & a5 & a6 & a7 & a8 & a9 & a10 & \  \\ 
b0 & b1 & b2 & b3 & b4 & b5 & b6 & b7 & b8 & b9 & b10 & \  \\ \hline
\end{tabular}
Christoph B.
  • 1,901

1 Answers1

2
\documentclass{article}
\usepackage{booktabs}

\usepackage[active,tightpage]{preview}% only for test
\PreviewEnvironment{tabular}
    \setlength\PreviewBorder{1em}

\begin{document}
\begin{tabular}{ *{11}{l} }
    \toprule
    & \multicolumn{4}{l}{parameter 1 } & \multicolumn{6}{l}{parameter 2}    \\ 
    \cmidrule(lr){2-5}\cmidrule(l){6-11}
    & d1 & d2 & d3 & d4 & d5 & d6 & d7 & d8 & d9 & d10                      \\
a0  & a1 & a2 & a3 & a4 & a5 & a6 & a7 & a8 & a9 & a10                      \\
b0  & b1 & b2 & b3 & b4 & b5 & b6 & b7 & b8 & b9 & b10                      \\ 
    \bottomrule
\end{tabular}
\end{document}

gives:

enter image description here

Zarko
  • 296,517
  • 1
    It should be & \multicolumn{4}{l}{parameter 1} & \multicolumn{6}{l}{parameter 2} instead of 5 and 5. – dexteritas Aug 15 '17 at 10:43
  • 1
    yes, it should be. i forgot to change it after removing spurious column before d5 :-(. thank you. corrected. – Zarko Aug 15 '17 at 11:12