[Tex/LaTex] Missing outer border of the table

tables

I have a table where the last column has no border at the right side.
Here is the code:

\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

    \DeclareMathOperator\prb{probability}
    \DeclareMathOperator\cost{cost}
    \DeclareMathOperator\child{child}

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


\begin{table}[!htbp]
  \centering
  \caption{Countermeasure solutions for connected vehicle}
   \label{Countermeasure solutions for connected vehicle}
   \begin{tabular}{ |m{2cm}| m{2.5cm} | m{2cm}|m{2cm}| m{2cm} | }
    \hline
    ID  &  cost  &  severity & probability & risk  \\ 
    \hline
        C1      &  300   &  8    & 0.5 \\
     \hline
        C2      &  200   &  8    & 0.5
    \\ \hline
        C1 and C2        &  500= 300 + 200   &  8   & 0.5
    \\ \hline
        T1     &  300    &  8    & 0.5
    \\ \hline
        T2     &  300    &  8    & 0.5
    \\ \hline

  \end{tabular}
\end{table}


\end{document}

enter image description here

So, why i don't have any any border on the column?

Best Answer

The line right is set by the leftmost cell, which is omitted in most of the rows. Fixed:

\begin{table}[!htbp]
  \centering
  \caption{Countermeasure solutions for connected vehicle}
   \label{Countermeasure solutions for connected vehicle}
   \begin{tabular}{ |m{2cm}| m{2.5cm} | m{2cm}|m{2cm}| m{2cm} | }
    \hline
    ID  &  cost  &  severity & probability & risk  \\
    \hline
        C1      &  300   &  8    & 0.5 & \\
     \hline
        C2      &  200   &  8    & 0.5 &
    \\ \hline
        C1 and C2        &  500= 300 + 200   &  8   & 0.5 &
    \\ \hline
        T1     &  300    &  8    & 0.5 &
    \\ \hline
        T2     &  300    &  8    & 0.5 &
    \\ \hline

  \end{tabular}
\end{table}

Result

BTW, you have loaded package booktabs twice. Why are you not using it?

\documentclass[runningheads,a4paper]{llncs}

\usepackage{booktabs}

\begin{document}
\begin{table}
  \centering
  \caption{Countermeasure solutions for connected vehicle}
   \label{Countermeasure solutions for connected vehicle}
   \begin{tabular}{lllll}
    \toprule
    ID  &  Cost  &  Severity & Probability & Risk  \\
    \midrule
        C1      &  300   &  8    & 0.5 & \\
        C2      &  200   &  8    & 0.5 & \\
        C1 and C2        &  $500 = 300 + 200$ &  8   & 0.5 & \\
        T1     &  300    &  8    & 0.5 & \\
        T2     &  300    &  8    & 0.5 & \\
    \bottomrule
  \end{tabular}
\end{table}
\end{document}

Result with booktabs

Related Question