[Tex/LaTex] Table center alignment doesn’t seem to work

longtabletables

\documentclass{article}

\begin{document}

\begin{table*}[!htb] 
\renewcommand{\arraystretch}{1.3}

\begin{center}  

\caption{ Hydrostatics of 3b Asymmetric Catamaran Model [{s/L} 0.3]}\label{tab1}

\begin{tabular}{|c|c|c|c|c|}    \hline
\textbf {Parameter} & \textbf {Catamaran}   & \textbf {Inboard Catamaran} & \textbf {Outboard Catamaran} & \textbf {Units}\\ \hline
Displacement &  349705 &    349705 &    349705  & Kg\\\hline
Draft Amidships &       2.457&      2.457&      2.457   &   m  \\ \hline
Wetted Surface Area &   499.612 &   499.612 &   499.612&    \(m^2\)\\ \hline
\(C{_B}\)   &0.432 &    0.432 & 0.432 & - \\ \hline
L/B &5.239 &    5.239 & 5.239&  - \\ \hline
B/T &   2.471&  2.471 & 2.471 & - \\ \hline
\(L/\Delta ^ {1/3}\)    & 5.395 &   5.395   &5.395 &    - \\ \hline
        \end{tabular}

    \end{center}

\end{table*} 

\end{document}

my last column is out of alignment

Best Answer

The problem is that the table is too wide. You can get a reasonable width by splitting the long headers.

I also suggest to avoid vertical rules. You can easily reinsert them, though, from the code below.

Some more notes.

  1. Don't use center, which adds unwanted vertical space.

  2. Be consistent with the use of math mode in the first column.

  3. For numeric tables, it's recommended to use siunitx.

  4. Units should be typeset in the format required by the International System. For instance, the symbol for the kilogram is kg, not Kg.

  5. An en-dash should be used for a missing value.

\documentclass{article}
\usepackage{booktabs,siunitx,makecell}


\begin{document}

\begin{table*}[!htb] 
\renewcommand{\arraystretch}{1.3}
\renewcommand\theadfont{\bfseries}

\centering

\caption{Hydrostatics of 3b Asymmetric Catamaran Model [\(s/L\ 0.3\)]}\label{tab1}

\begin{tabular}{
  @{}
  l
  S[table-format=3.3]
  S[table-format=3.3]
  S[table-format=3.3]
  c
  @{}
}
\toprule
\thead{Parameter} &
{\thead{Catamaran}} &
{\thead{Inboard \\ Catamaran}} &
{\thead{Outboard \\ Catamaran}} &
\thead {Units}\\
\midrule
Displacement        & \num{349705} & \num{349705} & \num{349705} & \si{\kg}  \\
Draft Amidships     &     2.457    &     2.457    &     2.457    & \si{\m}   \\
Wetted Surface Area &   499.612    &   499.612    &   499.612    & \si{\m^2} \\
\(C_B\)             &     0.432    &     0.432    &     0.432    & --        \\
\(L/B\)             &     5.239    &     5.239    &     5.239    & --        \\
\(B/T\)             &     2.471    &     2.471    &     2.471    & --        \\
\(L/\Delta^{1/3}\)  &     5.395    &     5.395    &     5.395    & --        \\
\bottomrule
\end{tabular}

\end{table*} 

\end{document}

enter image description here

Related Question