# Table border is not complete

I want to draw a table and i used the following code

\begin{table}[htbp]

\centering
\caption{Ship simulator required inputs}
\begin{tabular}{|c|c|}
\hline
L_{PP},  L_{WL}, L_{OS}, B, T, T_{a}, T_{f}, C_{B}, D_{P}, \\ Bulbous bow, Number of bosses, brackets, thrusters. & ship particulars \\ \hline
Required speed or propeller rpm, ship course angle & Mission data \\ \hline
BN, weather angle, water temperature & Environment \\  \hline
\end{tabular}%
\label{inputs}%
\end{table}%


the result of this is as shown in figure

How can i complete the right border of the table ??? I used \\ to break the line of first row

• add a & before the \\  on the first line so the line does not end short and has a cell that is empty but with a rule Oct 21 '14 at 14:41
• L_{PP} and other entries in the first cell need to be in math mode $L_{PP}$ you must get multiple errors from the code as posted? Oct 21 '14 at 15:09

## 2 Answers

A variant to have the first cell in last column vertically centred with respect to the first two rows. It uses the makecell package, which allows for multilines cells. It also has a \setcellgapes command that produces less tight vertical spacing in cells. I also load the caption package to have a correct vertical spacing between caption and table:

\documentclass{article}

\usepackage{array, caption}
\usepackage{makecell}
\setcellgapes{5pt}
\makegapedcells

\begin{document}

\begin{table}[htbp]

\centering
\caption{Ship simulator required inputs}
\begin{tabular}{|c|c|}
\hline
\makecell{$L_{PP}, L_{WL}, L_{OS}, B, T, T_{a}, T_{f}, C_{B}, D_{P},$ \\ Bulbous bow, Number of bosses, brackets, thrusters.} & ship particulars\\\hline
Required speed or propeller rpm, ship course angle & Mission data \\ \hline
BN, weather angle, water temperature & Environment \\ \hline
\end{tabular}%
\label{inputs}%
\end{table}%

\end{document}


The entries in the first cell need to be in math and you need a & to get the second (empty) cell to carry the vertical rule

Note the first L in your image is roman then you would have had an error message and TeX would have started math mode but never ended it so give another error message at the end of the cell. If you get error messages the pdf result is arbitrary nonsense. TeX does not try to recover with sensible output, just to recover to allow further commands to be checked for errors.

\begin{table}[htbp]

\centering
\caption{Ship simulator required inputs}
\begin{tabular}{|c|c|}
\hline
$L_{PP}$,  $L_{WL}$, $L_{OS}$, $B$, $T$, $T_{a}$, $T_{f}$, $C_{B}$, $D_{P}$ & \\
Bulbous bow, Number of bosses, brackets, thrusters. & ship particulars \\ \hline
Required speed or propeller rpm, ship course angle & Mission data \\ \hline
BN, weather angle, water temperature & Environment \\  \hline
\end{tabular}

\label{inputs}
\end{table}