Home > Latex > Decimal point alignment in Latex

Decimal point alignment in Latex

Decimal point alignment in Latex can be done in two different ways. But I prefer using dcolumn package because you will have the advantage of creating your own column type.

Include the package dcolumn and create a new column using the following command (you can add this in your document class).

\usepackage{dcolumn}

\newcolumntype{.}{D{.}{.}{-1}}

For defining table and heading you can use multicolumn as shown below:

\begin{tabular}{| c | . | . |}

\textbf{header 1} & \multicolumn{1} {|c|}{heading 2 } &  \multicolumn{1}{|c|} {Heading 3} \\

1 & 2563.05 & 2095.22 \\

…. (more data)

\end tabular

The image below illustrates the decimal point alignment in latex.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.