How tro put padded values into a results table?

Hello,
I have the following problem: I would like to cut cells from several images and save each cell in a separate folder. I want to name the folders like “001”, “002”,… But I want to know the name and the directory of the original images. For this, I would like to make a table with two columns: one for the number of the cell (001, 002,…) and another for the path of the original image. I tried to use the IJ.pad function to set whole numbers in the first column with 3 digits (001, 002,…). But it did not work. In the following code there are two ways to try it (the last two lines):

value=newArray(IJ.pad(1,3));
Table.create("AllCells");
Table.setColumn("Cell number", value);
Table.setColumn("Directory", value);
Table.setLocationAndSize(200, 200, 800, 500);
Table.set("Cell number", Table.size,(IJ.pad(5,3)));
Table.set("Cell number", Table.size,(IJ.pad(Table.size,3)));

The result was a table with two columns headed “Cell number” and “Directory”, and the columns looked like this:

Cell number               Directory
 001                      001
 5                        0
 2                        0

I tried many ways, but coud not make the code to set padded numbers into the table. How coulod I do it? There was a way when the value put in the table was not padded, but when I had it printed in the log window, it was. I do not remember how I did that, but anyway, that was not what I wanted.

I have found a way to make my macro write padded numbers in the table using this line:

Table.set("Cell number", Table.size,IJ.pad((Table.size+1), 3));

With this I get the number of the last row written in the first column in a padded format. If I repeat theis line in the macro, then I get an increasing number of padded numbers of the corresponding rows. That is fine, however, when I save the table and open it again, then all the valuses passed before saving are unpadded (if a word like this exists), that is instead of “001”, “002”,… the cells contain “1”, “2”,… If I start running the macro again, then the new numbers are in the padded format, but upon saving and reopening the table they become unpadded too. How could I keep the padded format after saving?