0

I have the following code in latex

{\begin{array}{c|c}
integer&real\\\hline
1&114.12382811\\
2&64.284747272\\
3&0.000267356293929\\
4&273912624.91\\
\vdots&\vdots\\
\end{array}
}

I am wanting to form a table with headers and division lines but the numbers in the right hand column need to be aligned on the decimal point, I know this can be done (it can be seen here Aligning numbers by decimal points in table columns ) however I am unsure of how to combine this with the table I want to produce. Thanks in advance.

1 Answer 1

2

You can use the S columntype, from siunitx for that:

\documentclass{article}
\usepackage{array, siunitx}

\begin{document}

\[ \begin{array}{c|S[table-format =9.15, table-number-alignment=center]}
\text{integer} & {\text{real}} \\
\hline
1&114.12382811\\
2&64.284747272\\
3&0.000267356293929\\
4&273912624.91\\
\vdots&{\vdots} \\
\end{array} \]

\end{document}

enter image description here

0

You must log in to answer this question.