1

I am having an issue with a table with one column containing multiple columns. After the multicolumn (named "Power Factor" in this case) the remaining columns do not have a vertical line joining the cell below, any ideas on how to solve? thanks in advance! Mike

\begin{table}[ht!]
        \caption{Multi-column table}

    \begin{center}
        \begin{tabular}{|p{1.8cm}||p{1.5cm}|p{1.5cm}|p{2.5cm}|p{2.2cm}|p{1.5cm}|p{3.0cm}|p{1.7cm}|}
        \hline
        \center Concept & \multicolumn{2}{|c|}{Power Factor}  & Power \newline Requirement & Total Power \newline Losses* & Energy Costs & Power Recovery \newline Savings & Max. Overload \\
        \cline{2-3}
         & Hoisting Motor & Lifting Motor    \\ 
        \hline
         Concept 1 & 0.71  & 0.75 & 5.76 kW & 2.02 kW & 17199 \euro & 2210 \euro & 25 \%  \\
         \hline
         Concept 2 & 0.82  & 0.81 & 7.93 kW & 2.43 kW & 16317 \euro & 2487 \euro & 58 \%   \\
         \hline
         Concept 3 & 0.83  & 0.77 & 7.40 kW & 2.19 kW & 15616 \euro & 2197 \euro & 61 \%   \\
        \hline
        \end{tabular}
    \end{center}
    \label{tab:multicol}
    \end{table}
1
  • \center is the wrong command to use. It is \centering
    – egreg
    Jun 21, 2016 at 21:56

2 Answers 2

2

Please always post complete documents not fragments but your table has 8 columns but

 & Hoisting Motor & Lifting Motor    \\ 

only has 3, so the last cells including the vertical rules are omitted, you need

  & Hoisting Motor & Lifting Motor  &&&&&  \\ 

Also

\multicolumn{2}{|c|}{Power Factor}

should be

\multicolumn{2}{c|}{Power Factor}

as (apart from the first cell) rules are at the right edge of each cell so a rule added to the left with \multicolumn will not align with any rules specified in the table preamble.

1
  • I am rather ashamed that I did not notice the missing ampersands... I think it is about time to get some rest... thank you so much for the correct answer and the extra tip!
    – Miccio
    Jun 21, 2016 at 20:21
3

I would like to suggest that you give your table a more "open" look by removing all vertical lines -- trust me, they won't be missed! -- and many horizontal lines and by using the line-drawing macros of the booktabs package for the remaining horizontal lines.

enter image description here

\documentclass{article}
\usepackage[a4paper,margin=2.5cm]{geometry} % set text block parameters suitably
\usepackage{eurosym,array,ragged2e,booktabs,caption}
\newcolumntype{C}[1]{>{\Centering\arraybackslash}p{#1}}
\begin{document}
\begin{table}[ht!]
\caption{Multi-column table} \label{tab:multicol}
\setlength\tabcolsep{3pt} % default value: 6pt
\centering
\begin{tabular}{@{} p{1.7cm} C{1.2cm} C{1.2cm} C{1.8cm} C{1.9cm} C{1.3cm} C{2.4cm} C{1.4cm} @{}}
\toprule
Concept & \multicolumn{2}{c}{Power Factor}  & Power Requirement & Total Power Losses* & Energy Costs & Power Recovery Savings & Max.\ Overload \\
\cmidrule{2-3}
 & Hoisting Motor & Lifting Motor    \\ 
\midrule
 Concept 1 & 0.71  & 0.75 & 5.76 kW & 2.02 kW & 17199 \euro & 2210 \euro & 25 \%  \\
 \addlinespace
 Concept 2 & 0.82  & 0.81 & 7.93 kW & 2.43 kW & 16317 \euro & 2487 \euro & 58 \%   \\
 \addlinespace
 Concept 3 & 0.83  & 0.77 & 7.40 kW & 2.19 kW & 15616 \euro & 2197 \euro & 61 \%   \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
1
  • Thank yo Mico! I think the "open" look does indeed better.. once again than you for spending the time to help me out.
    – Miccio
    Jun 23, 2016 at 15:03

You must log in to answer this question.

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