表格:最右边的垂直线有问题 :(

表格:最右边的垂直线有问题 :(
\documentclass[11pt,a4paper,onesided]{report}
\usepackage[utf8]{inputenc}
\usepackage[showframe, nomarginpar, left=1.5in, right=1in, top=1.5in, bottom=1in,]{geometry}
\usepackage{array}
\usepackage[font = small]{caption}
\usepackage{multirow}
\usepackage{makecell}
\begin{document}

\begin{table}[htbp]
\centering
\caption{Caption}
\begin{tabular}{|c||cccccccc|}
 \hline
%     \hline 
 \\
\multirowthead{2}{INR \\ Trillion}
& \multirowthead{2}{FY\\ 2005}
& \multirowthead{2}{FY\\ 2006}
& \multirowthead{2}{FY\\ 2007}    
& \multirowthead{2}{FY\\ 2008}    
& \multirowthead{2}{FY\\ 2009}    
& \multirowthead{2}{FY\\ 2010}    
& \multirowthead{2}{FY\\ 2011}    
& \multirowthead{2}{CAGR \\ (FY05-11)}  \\ \\ \\
 \hline \hline \\


\multirowthead{2}{Capital\\ Employed} & \multirowthead{2}{5.04} & \multirowthead{2}{5.85} & \multirowthead{2}{6.61} & \multirowthead{2}{7.24} & \multirowthead{2}{7.92} & \multirowthead{2}{9.08} & \multirowthead{2}{9.49} & \multirowthead{2}{11.1\%} \\ \\ \\ \hline \\

{Turnover} & 7.44 & 8.37 & 9.65 & 10.96 & 12.72 & 12.45 & 14.73 & 12.1\% \\ \\ 
\hline \\

\multirowthead{2}{Total\\Income}& \multirowthead{2}{7.35} & \multirowthead{2}{8.30} & \multirowthead{2}{9.70} & \multirowthead{2}{11.03} & \multirowthead{2}{13.10} & \multirowthead{2}{12.72} & \multirowthead{2}{14.98} & \multirowthead{2}{12.6}\% \\ \\ \\
\hline \\

{Networth} & 3.42 & 3.97 & 4.54 & 5.18 & 5.83 & 6.53 & 7.15 & 13.1\% \\ \\ \hline  \\   

{PBT} & 1.08 & 1.14 & 1.39 & 1.53 & 1.42 & 1.60 & 1.71 & 7.9\% \\ \\ \hline \\

{Net Profit} & 0.64 & 0.66 & 0.77 & 0.80 & 0.69 & 0.84 & 0.86 & 5.1\% \\ \\ \hline \\      

{Total PSEs} & 227 & 226 & 217 & 214 & 213 & 217 & 220 & -- \\ \\   \\ \hline \\

\multirowthead{2}{Profit Making\\ PSEs} & \multirowthead{2}{143} & \multirowthead{2}{160} & \multirowthead{2}{154} & \multirowthead{2}{160} & \multirowthead{2}{158} & \multirowthead{2}{157} & \multirowthead{2}{158} & \multirowthead{2}{--} \\ \\ \\ \hline \\

\multirowthead{2}{Loss \\Making PSEs} & \multirowthead{2}{73} & \multirowthead{2}{63} & \multirowthead{2}{61} & \multirowthead{2}{54} & \multirowthead{2}{55} & \multirowthead{2}{60} & \multirowthead{2}{62} &  \multirowthead{2}{--}\\ \\ \\
\hline


\end{tabular}
\end{table}

\end{document}

答案1

你做的事情比实际情况要复杂得多。无论如何,缺失规则的解释是,过早结束一行\\不会绘制与未指定单元格相对应的规则。

这是一个更简单的版本;\fsc如果您不希望所有行的高度相同,只需从单元格中删除即可。

\documentclass[11pt,a4paper,oneside]{report}
\usepackage[utf8]{inputenc}
\usepackage[showframe, nomarginpar, left=1.5in, right=1in, top=1.5in, bottom=1in,]{geometry}
\usepackage{array}
\usepackage[font = small]{caption}

\newcommand{\splitcell}[1]{\begin{tabular}{@{}c@{}}\strut#1\strut\end{tabular}}
\newcommand{\fsc}{\vphantom{\splitcell{\\}}}

\begin{document}

\begin{table}[htbp]
\centering
\caption{Caption}
\begin{tabular}{|c||cccccccc|}
 \hline
\splitcell{INR \\ Trillion}
& \splitcell{FY\\ 2005}
& \splitcell{FY\\ 2006}
& \splitcell{FY\\ 2007}    
& \splitcell{FY\\ 2008}    
& \splitcell{FY\\ 2009}    
& \splitcell{FY\\ 2010}    
& \splitcell{FY\\ 2011}    
& \splitcell{CAGR \\ (FY05-11)}  \\
 \hline \hline

\splitcell{Capital\\ Employed} & 5.04 & 5.85 & 6.61 & 7.24 & 7.92 & 9.08 & 9.49 & 11.1\% \\
\hline

\fsc Turnover & 7.44 & 8.37 & 9.65 & 10.96 & 12.72 & 12.45 & 14.73 & 12.1\% \\
\hline

\splitcell{Total\\Income}& 7.35 & 8.30 & 9.70 & 11.03 & 13.10 & 12.72 & 14.98 & 12.6\% \\
\hline

\fsc Networth & 3.42 & 3.97 & 4.54 & 5.18 & 5.83 & 6.53 & 7.15 & 13.1\% \\
\hline 

\fsc PBT & 1.08 & 1.14 & 1.39 & 1.53 & 1.42 & 1.60 & 1.71 & 7.9\% \\
\hline

\fsc Net Profit & 0.64 & 0.66 & 0.77 & 0.80 & 0.69 & 0.84 & 0.86 & 5.1\% \\
\hline

\fsc Total PSEs & 227 & 226 & 217 & 214 & 213 & 217 & 220 & -- \\
\hline

\splitcell{Profit Making\\ PSEs} & 143 & 160 & 154 & 160 & 158 & 157 & 158 & -- \\
\hline

\splitcell{Loss \\Making PSEs} & 73 & 63 & 61 & 54 & 55 & 60 & 62 &  --\\
\hline

\end{tabular}
\end{table}

\end{document}

在此处输入图片描述

booktabs如果您使用并放弃垂直规则,您将获得更好看的表格。

\documentclass[11pt,a4paper,oneside]{report}
\usepackage[utf8]{inputenc}
\usepackage[showframe, nomarginpar, left=1.5in, right=1in, top=1.5in, bottom=1in,]{geometry}
\usepackage{array,booktabs}
\usepackage[font = small]{caption}

\newcommand{\splitcell}[1]{\begin{tabular}{@{}c@{}}\strut#1\strut\end{tabular}}
\newcommand{\fsc}{\vphantom{\splitcell{\\}}}

\begin{document}

\begin{table}[htbp]
\centering
\caption{Caption}
\begin{tabular}{ccccccccc}
\toprule
\splitcell{INR \\ Trillion}
& \splitcell{FY\\ 2005}
& \splitcell{FY\\ 2006}
& \splitcell{FY\\ 2007}    
& \splitcell{FY\\ 2008}    
& \splitcell{FY\\ 2009}    
& \splitcell{FY\\ 2010}    
& \splitcell{FY\\ 2011}    
& \splitcell{CAGR \\ (FY05-11)}  \\
\midrule

\splitcell{Capital\\ Employed} & 5.04 & 5.85 & 6.61 & 7.24 & 7.92 & 9.08 & 9.49 & 11.1\% \\

\fsc Turnover & 7.44 & 8.37 & 9.65 & 10.96 & 12.72 & 12.45 & 14.73 & 12.1\% \\

\splitcell{Total\\Income}& 7.35 & 8.30 & 9.70 & 11.03 & 13.10 & 12.72 & 14.98 & 12.6\% \\

\fsc Networth & 3.42 & 3.97 & 4.54 & 5.18 & 5.83 & 6.53 & 7.15 & 13.1\% \\

\fsc PBT & 1.08 & 1.14 & 1.39 & 1.53 & 1.42 & 1.60 & 1.71 & 7.9\% \\

\fsc Net Profit & 0.64 & 0.66 & 0.77 & 0.80 & 0.69 & 0.84 & 0.86 & 5.1\% \\

\fsc Total PSEs & 227 & 226 & 217 & 214 & 213 & 217 & 220 & -- \\

\splitcell{Profit Making\\ PSEs} & 143 & 160 & 154 & 160 & 158 & 157 & 158 & -- \\

\splitcell{Loss \\Making PSEs} & 73 & 63 & 61 & 54 & 55 & 60 & 62 &  --\\
\bottomrule
\end{tabular}
\end{table}

\end{document}

在此处输入图片描述

答案2

另一种方法是,使用hhline框架makecell命令在单元格上方和下方添加垂直间距并siunitx垂直对齐小数点:

\documentclass[a4paper,onesided]{report}

\usepackage[utf8]{inputenc}
\usepackage[nomarginpar, left=1.5in, right=1in, top=1.5in, bottom=1in,]{geometry}
\usepackage{array}
\usepackage[font = small]{caption}
\usepackage{multirow}
\usepackage{siunitx}
\usepackage{makecell}%
\renewcommand{\theadgape}{\Gape[6pt]}
\usepackage{hhline}
\newcommand\myhline{\hhline{|-||--------|}}
\begin{document}

\begin{table}[htbp]
\centering
\caption{Caption}
\begin{tabular}{|c||*{7}{S}S[table-figures-decimal=1,table-figures-integer=2]|}
 \hline
\thead{INR \\ Trillion}
  & {\thead{FY\\ 2005}}%
 & {\thead{FY\\ 2006}}
& {\thead{FY\\ 2007}}
& {\thead{FY\\ 2008}}
& {\thead{FY\\ 2009}}
& {\thead{FY\\ 2010}}
& {\thead{FY\\ 2011}}
&\multicolumn{1}{c|}{ \thead{CAGR \\ (FY05-11)}}
\\
 \hhline{|=::========|}
\thead{Capital\\ Employed} & 5.04 & 5.85 & 6.61 & 7.24 & 7.92 & 9.08 & 9.49 & 11.1{$ \!\! \!$\%} \\
\myhline
\thead{Turnover} & 7.44 & 8.37 & 9.65 & 10.96 & 12.72 & 12.45 & 14.73 & 12.1{$ \!\! \!$\%} \\
\myhline
\thead{Total\\Income}& 7.35 & 8.30 & 9.70 & 11.03 & 13.10 & 12.72 & 14.98 & 12.6{$ \!\! \!$\%} \\
\myhline
\thead{Networth} & 3.42 & 3.97 & 4.54 & 5.18 & 5.83 & 6.53 & 7.15 & 13.1{$ \!\! \!$\%} \\
\myhline
\thead{PBT} & 1.08 & 1.14 & 1.39 & 1.53 & 1.42 & 1.60 & 1.71 & 7.9 \% \\
\myhline
\thead{Net Profit} & 0.64 & 0.66 & 0.77 & 0.80 & 0.69 & 0.84 & 0.86 & 5.1\% \\
 \hhline{|=::========|}
\thead{Total PSEs} & {227} & 226 & 217 & 214 & 213 & 217 & 220 & \multicolumn{1}{c|}{---} \\
\myhline
\thead{Profit Making\\ PSEs} & {143} & 160 & 154 & 160 & 158 & 157 & 158 & \multicolumn{1}{c|}{---} \\
\myhline
\thead{Loss \\Making PSEs} & {73} & 63 & 61 & 54 & 55 & 60 & 62 &  \multicolumn{1}{c|}{---} \\
\myhline
\end{tabular}
\end{table}

\end{document} 

在此处输入图片描述

相关内容