I have a table containing decimal numbers in one column. I\'m looking to align them in a manner similar to a word processor\'s \"decimal tab\" feature, so that all the poin
I'm surprised that in 10 years of answers to this question, nobody ever mentioned the Unicode character 'FIGURE SPACE' (U+2007, )
It's a whitespace character that is designed (by font authors, if they follow the standard) to be the same width as digits and to keep its spacing, like its more famous cousin the No-Break Space. You can use it to pad numbers to a certain string size, either on the left or on the right hand side, taking care of aligning the column or div on the same side.
Examples, both left-aligned and left-padded with figure spaces:
10000
123.4
3.141592
10000
123.4
3.141592