I'm trying to format a table in a cell using the CSV module, but for some reason, the numbers aren't aligning up with the text. I've tried using the format string with the old method and the new method, but it still doesn't work. Any ideas on how I could get these numbers to align with the text? Thanks.
Code:
variant_id = category['variantSetId']
sizes = "{}\n{}".format(
" ".join(
["%-20i" % size['variantId'] for size in category['sizes']]),
" ".join(
["%-20s" % size['text'] for size in category['sizes']])
)
writer.writerow((variant_id, sizes))
CSV Output
