I want to have my numbers aligned vertically at decimal point. I tried to use {siunitx} and {dcolumn} packages, but they did not work to generate the table that I want to.
\begin{table}
\centering
\captionsetup{justification=centering,margin=1.5cm}
\begin{tabular}{|p{1.2cm}|p{2cm}|p{2cm}|p{2cm}|p{2cm}|}
\hline
Angle & Time (sec)& cost function with DC (Nm$)^2$s & cost function with GPOPS-II (Nm$)^2$s & cost function with Shooting (Nm$)^2$s \\ \hline
& 0.5 & 44.22 & 42.25 & 42.99 \\ \cline{2-5}
$45^{\circ}$ & 1 & 12.68 & 11.29 & 11.04\\ \cline{2-5}
& 2 & 7.14 & 11.29 & N/A \\ \cline{2-5}
& 4 & 4.41 & 11.28 & N/A\\ \hline
& 0.5 & 192.71 & 184.70 & 188.66 \\ \cline{2-5}
$90^{\circ}$ & 1 & 41.33 & 37.59 & 37.21 \\ \cline{2-5}
& 2 & 23.47 & 36.95 & N/A \\ \cline{2-5}
& 4 & 14.43 & 36.96 & N/A \\ \hline
& 0.5 & 1002.90 & 962.44 & 992.26 \\ \cline{2-5}
$180^{\circ}$ & 1 & 157.81 & 148.12 & N/A \\ \cline{2-5}
& 2 & 72.51 & 66.13 & N/A \\ \cline{2-5}
& 4 & 32.05 & 66.85 & N/A \\ \hline
& 0.5 & 4118.20 & N/A & 4231.74 \\ \cline{2-5}
$360^{\circ}$ & 1 & 650.87 & 651.16 & 658.81 \\ \cline{2-5}
& 2 & 182.65 & 182.73 & N/A \\ \cline{2-5}
& 4 & 109.12 & 134.11 & N/A \\ \hline
\end{tabular}
\newline\newline
\caption[Cost function values from DC, GPOPS-II , and Shooting]{Cost function values from DC, GPOPS-II , and Shooting. N/A indicates that the method was not able to solve the problem}
\label{Table1}
\end{table}
This is the table I am talking about:




dcolumnandsiunitxpackages to work if you don't use their dedicated column types? – Mico Jul 31 '16 at 19:26