Cline not connecting fully in table with custom lines
The array
package offers !{decl.}
with <decl.>
being used instead of the vertical line. To get a 1pt wide vertical line, you can use \vrule width 1pt
. You can also declare a new column type based on this, using something like \newcolumntype{V}{!{\vrule width 1pt}}
. (I used V
instead of your original "
here to avoid possible conflicts with the babel
package since "
is a shorthand in some languages.)
Instead of your definition of the \thickrule
command, you could also use \Xhline
from the makecell
package. It accepts a width as its argument: \Xhline{1pt}
If you plan on using the thicker vertical and horizontal lines multiple times throughout your document, you might be interested in defining their widths in the pramble as I did in the following example.
In the following MWE, I also included a second version of your table that makes use of the booktabs
package for a layout without vertical and wih less horizontal lines. There I also added the siunitx
pacage in order to typeset units:
\documentclass{article}
\usepackage{array}
\usepackage{multirow}
\usepackage{makecell}
\newlength{\mytablinewidth}
\setlength{\mytablinewidth}{1pt}
\newcommand{\myhline}{\Xhline{\mytablinewidth}}
\newcolumntype{V}{!{\vrule width \mytablinewidth}}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}[h]
\centering
\begin{tabular}{|c|>{\centering\arraybackslash}p{1cm}V>{\centering\arraybackslash}p{1cm}|>{\centering\arraybackslash}p{1cm}|>{\centering\arraybackslash}p{1cm}|}
\hline
\multicolumn{2}{|cV}{\multirow{2}{*}{}} & \multicolumn{3}{c|}{Retort Diameter (mm)} \\ \cline{3-5}
\multicolumn{2}{|cV}{} & 750 & 1000 & 1200 \\ \myhline
\multirow{3}{*}{Gas Flow (SLM)} & 25 & 5.7 & 3.2 & 2.2 \\ \cline{2-5}
& 50 & 11 & 6.4 & 4.4 \\ \cline{2-5}
& 75 & 17 & 9.6 & 6.6 \\ \hline
\end{tabular}
\caption{Approximate Peclet values}
\label{tb:Peclet}
\end{table}
\begin{table}[h]
\centering
\begin{tabular}{ccccc}
\toprule
& & \multicolumn{3}{c}{Retort Diameter} \\
& & \multicolumn{3}{c}{(\si{\mm})} \\
\cmidrule{3-5}
& & 750 & 1000 & 1200 \\
\midrule
\multirow{3}{*}{\makecell[cl]{Gas Flow \\ (SLM)}}& 25 & 5.7 & 3.2 & 2.2 \\
& 50 & 11 & 6.4 & 4.4 \\
& 75 & 17 & 9.6 & 6.6 \\
\bottomrule
\end{tabular}
\caption{Approximate Peclet values}
\label{tb:Peclet2}
\end{table}
\end{document}
In addition to the !
trick already mentioned by leandriis, you can use the w
column type that's much lighter codewise.
Also you could remove the empty rectangle at the upper left. But there are better ways to typeset the table, in my opinion, and I present one below.
\documentclass{article}
\usepackage{array,multirow}
\usepackage{booktabs}
\makeatletter
\newcommand{\thickhline}{%
\noalign {\ifnum 0=`}\fi \hrule height 1pt
\futurelet \reserved@a \@xhline
}
\newcolumntype{"}{!{\vline width 1pt}}
\makeatother
\newcommand{\smashedheader}[2][c]{%
\smash{\begin{tabular}[t]{@{}#1@{}}#2\end{tabular}}%
}
\begin{document}
\begin{tabular}{| c | w{c}{1cm} " w{c}{1cm} | w{c}{1cm} | w{c}{1cm} |}
\cline{3-5}
\multicolumn{2}{c"}{\multirow{2}{*}{}} & \multicolumn{3}{c|}{Retort Diameter (mm)} \\
\cline{3-5}
\multicolumn{2}{c"}{} & 750 & 1000 & 1200 \\
\thickhline
\multirow{3}{*}{Gas Flow (SLM)} & 25 & 5.7 & 3.2 & 2.2 \\
\cline{2-5}
& 50 & 11 & 6.4 & 4.4 \\
\cline{2-5}
& 75 & 17 & 9.6 & 6.6 \\
\hline
\end{tabular}
\bigskip
\begin{tabular}{ @{} c w{c}{1.5cm} w{c}{1.5cm} w{c}{1.5cm} @{} }
\toprule
\smashedheader{Gas Flow \\ (SLM)} & \multicolumn{3}{c@{}}{Retort Diameter (mm)} \\
\cmidrule(l){2-4}
& 750 & 1000 & 1200 \\
\midrule
25 & 5.7 & 3.2 & 2.2 \\
50 & 11 & 6.4 & 4.4 \\
75 & 17 & 9.6 & 6.6 \\
\bottomrule
\end{tabular}
\end{document}