I agree with you both: if I can, I select an entire column and set a decimal tab. But there are occasions where I opt for Figure spaces — I even assigned a hotkey to it.
This script has been in the making for some time, because usually when I only have to align 1 or 2 numbers (or 3 or 4 or …), I set my mind on Blank and go moovin' that ol' cursor around an' hittin' the Figure Space shortcut, but all the while I'm thinking “hold on, there's got to be a better way”.
Surprisingly, this script is quite versatile: you can select any number of cells, horizontally, vertically, or even an entire Table. It uses a tiny GREP instruction to count the number of leading digits, so it will ignore anything that may come after it (such as decimal points, percentage signs, or a text such as “bottles of beer”). The longest decimal run count is saved, then it loops again over your selection, counting the digits that are in each cell and inserting Figure Spaces at the start to match the longest run.
Copy, paste into the ESTK Editor that came with InDesign. Save into your User Scripts folder, select any number of cells, then run the script:
//DESCRIPTION:Align Digits in Selected Column(s) in Table with Figure Spaces
// 11-Aug-2010 A Jongware Script
if (app.documents.length > 0 && app.selection.length == 1 && (app.selection[0] instanceof Column || app.selection[0] instanceof Cell || app.selection[0] instanceof Row || app.selection[0] instanceof Table))
{
txt = app.selection[0].cells.everyItem().contents;
longest = 0;
for (i=0; i<txt.length; i++)
{
nspan = txt[i].match(/^d+/);
if (!nspan) continue;
if (nspan[0].length > longest)
longest = nspan[0].length;
}
for (i=0; i<txt.length; i++)
{
nspan = txt[i].match(/^d+/);
if (!nspan) continue;
add = longest-nspan[0].length;
while (add– > 0)
app.selection[0].cells[i].texts[0].insertionPoints[0].contents = SpecialCharacters.FIGURE_SPACE;
}
} else
alert (“No table column(s) selected”);