Rob is on point. As written, the formatting is being done at compile time so room needs to be left for the longest possible value. If that is not what you want, compose the string in advance, clean up as needed, and display the string as a whole ... or, use put unformatted, which would be appropriate for outputting HTML, JSON, and the like.