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?

4

Just as you did on the line above:

replace

5.0

by

\multicolumn{1}{c|}{5.0}

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.