0

Why are the last 4 vertical lines in this table not connected to the top horizontal line?enter image description here

\documentclass[]{article}
\begin{document}
    \begin{tabular}{| c | c | c | c | c |}
        \hline \\
        15&2.5&10&7.5&5\\ 
        \hline 
    \end{tabular}
\end{document}
  • Do you really want an empty line as 1st line? – Sigur Dec 30 '17 at 12:48
2

If you want an empty line in the 1st line you have to change the columns with & before change the line:

\hline &&&&  \\

If you don't want, simply:

\hline 15 & 2.5 & 10 & 7.5 & 5 \\ 

MWE

\documentclass[]{article}
\begin{document}
    \begin{tabular}{| c | c | c | c | c |}
        \hline &&&&  \\
        15&2.5&10&7.5&5\\ 
        \hline 
    \end{tabular}

\medskip

    \begin{tabular}{| c | c | c | c | c |}
        \hline % &&&&  \\
        15&2.5&10&7.5&5\\ 
        \hline 
    \end{tabular}
\end{document}

enter image description here

1

Another version you are probably interested in.

enter image description here

Code:

\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{table}
\begin{tabular}{|l|l|l|l|l|}  \hline
\multirow{2}{*}{15} & \multirow{2}{*}{2.5} & \multirow{2}{*}{10} & \multirow{2}{*}{7.5} & \multirow{2}{*}{5} \\ 
&&&& \\\hline      
\end{tabular}
\end{table}
\end{document}
  • Nice vertical spacing! – Will A. Dec 31 '17 at 17:02

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.