I don’t know if it’s possible with common string formatting or advanced string formatting, so thought to ask…
I have this simplified snippet:
>>> s = 'some string'
>>> y = 10
>>> '<td>%s</td><td>%4d</td>' % (s, y)
'<td>some string</td><td> 10</td>'
I want to pad numeric cell with as my html backend doesn’t accept text aligning.
Is there easy way to format numerical value with instead empty space?
You could use something like: