表格标题没有边框

表格标题没有边框

我有两个表格,它们的标题都没有垂直边框。代码如下:

\documentclass[runningheads,a4paper]{llncs}

\usepackage{amssymb}
\setcounter{tocdepth}{2}
\usepackage{graphicx}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}

\usepackage{float}
\usepackage{booktabs}


\usepackage{mathtools}

\usepackage{amsmath}
\usepackage[english]{babel}
\usepackage{booktabs,array}
\usepackage{lipsum}
\usepackage{hhline}% http://ctan.org/pkg/hhline


\setcounter{secnumdepth}{5}
\begin{document}


\begin{table}[htbp]
  \centering
  \caption{Quantification of opportunities of threat agent}
  \begin{tabular}{|c|c|c|c|c|}
    \hline
    \multicolumn{5}{c}{Opportunities (Number of trial tries)} \\
    \hhline{-----}
     Level  & Zero &    One &  Finite & Infinite \\
    \hline
    Score   & 0    &    1   &  4      & 10 \\
    \hline
  \end{tabular}
  \label{threat agent Opportunities}
\end{table}


\end{document}

下图显示了缺失的垂直边框 在此处输入图片描述

答案1

既然您正在加载该booktabs包,您不妨抓住机会大大改善表格材料的“外观”,方法是(a)去掉所有垂直线,(b)实际使用包的线条绘制宏—— booktabs、、\toprule\midrule\bottomrule就当前表格而言)。

在此处输入图片描述

\documentclass[runningheads,a4paper]{llncs}
% I've simplified the preamble to the bare minimum...
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{booktabs}

\begin{document}

\begin{table}[htbp]
  \centering
  \caption{Quantification of opportunities of threat agent}
  \label{threat agent Opportunities}
  \begin{tabular}{ccccc}
    \toprule
    \multicolumn{5}{c}{Opportunities } \\
    \multicolumn{5}{c}{(Number of trial tries)}\\
    \midrule
     Level  & Zero &    One &  Finite & Infinite \\
    Score   & 0    &    1   &  4      & 10 \\
    \bottomrule
  \end{tabular}
\end{table}

\end{document}

答案2

在此处输入图片描述

只需更改\multicolumn{5}{c}\multicolumn{5}{|c|}

相关内容