2

The following code:

\documentclass[12pt]{article}
\begin{document}

\begin{table}[t]
\centering
\begin{tabular}{c|cccccccc}
\hline
id & \multicolumn{4}{c|}{Col1} & \multicolumn{4}{c}{Col2}\\
  & 0.5 & 1.0 & 3.0 & 5.0 & 0.1 & 0.5 & 1.0 & 3.0 \\
\hline
$1$  & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 \\
$2$  & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 \\
$3$  & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 \\
$4$  & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 \\
$5$  & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 \\
$6$  & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 & 0.5 \\
\hline
\end{tabular}
\end{table}

\end{document}

produces a table that looks like this:

enter image description here

I need to make it so the vertical line will extend to the second row too and stop there.

How can I do this?

lockstep
  • 250,273
Gabriel
  • 2,203

1 Answers1

4

Just as you did on the line above:

replace

5.0

by

\multicolumn{1}{c|}{5.0}
David Carlisle
  • 757,742