Last active
December 14, 2015 21:19
-
-
Save RazerM/5150731 to your computer and use it in GitHub Desktop.
LaTeX: Number aligned table #snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Needs \usepackage{float} for {H} | |
\begin{table}[H] | |
\centering | |
% table-format is defined as a.b where a is number of figures before decimal point, b is number of decimal places | |
\begin{tabular}{S[table-format=1]S[table-format=2.1]} %First S sets format for both columns, but each can have different table-format | |
\toprule | |
{ Distance (\si{\metre}) } & { Speed (\si{mi\per\hour}) }\\ %Non-number input must be surrounded with { } | |
\midrule | |
0 & 0 \\ | |
1 & 1.1 \\ | |
2 & 3.2 \\ | |
3 & 5.7 \\ | |
4 & 9.6 \\ | |
5 & 12.4 \\ | |
\bottomrule | |
\end{tabular} | |
\caption{Car speed test} | |
\label{tab:speed-test} | |
\end{table} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment