Need help with padding(i think?)

My program uses string.format to print a table out line by line from a file, which works fine, but it doesn't line up well I tried to fix this by making the end of each column add spaces onto the end, so that they would all be the same length - however I cant figure out how The closest ive gotten is by using 0 padding, but #1 this only works with integers, and two this only seems to work on the left side (btw this might not be called padding, im still learning string.format)
27 Replies
JavaBot
JavaBot3d ago
This post has been reserved for your question.
Hey @bed! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
ayylmao123xdd
ayylmao123xdd3d ago
how do you want it to line up also show the current code
bed
bedOP3d ago
well it does this atm
No description
bed
bedOP3d ago
and this is the line responsible
No description
bed
bedOP3d ago
i want the lines to all be in line but i cant figure out how
dan1st
dan1st3d ago
Are you using a fixed-width font?
bed
bedOP3d ago
a what
dan1st
dan1st3d ago
I'll show you something
bed
bedOP3d ago
sorry if that sounded crude i just dk what that is
dan1st
dan1st3d ago
Do you see a difference between MMM iii and
MMM
iii
MMM
iii
bed
bedOP3d ago
wait are you suggesting that my comic sans font is what might be causing this
dan1st
dan1st3d ago
yes
bed
bedOP3d ago
oh my god it all makes sense now
ayylmao123xdd
ayylmao123xdd3d ago
whats the font name monoscape right for it
bed
bedOP3d ago
the font i use is comic sans
dan1st
dan1st3d ago
teletype fonts are useful here
bed
bedOP3d ago
i changed it for jokes and didnt realise it could affect code are teletype fonts ones that dont change
ayylmao123xdd
ayylmao123xdd3d ago
would monoscape work in this case
dan1st
dan1st3d ago
yes
bed
bedOP3d ago
ah alright
dan1st
dan1st3d ago
teletype = monospace mostly
bed
bedOP3d ago
you're a life saver man thank you so much
JavaBot
JavaBot3d ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
bed
bedOP3d ago
you don't want to know how long i spent with that appreciate u
ayylmao123xdd
ayylmao123xdd3d ago
fun fact lego star wars uses monoscape
bed
bedOP3d ago
thats cool
JavaBot
JavaBot3d ago
Post Closed
This post has been closed by <@1167522887947796590>.

Did you find this page helpful?