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
JavaBot2mo 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
ayylmao123xdd2mo ago
how do you want it to line up also show the current code
bed
bedOP2mo ago
well it does this atm
No description
bed
bedOP2mo ago
and this is the line responsible
No description
bed
bedOP2mo ago
i want the lines to all be in line but i cant figure out how
dan1st
dan1st2mo ago
Are you using a fixed-width font?
bed
bedOP2mo ago
a what
dan1st
dan1st2mo ago
I'll show you something
bed
bedOP2mo ago
sorry if that sounded crude i just dk what that is
dan1st
dan1st2mo ago
Do you see a difference between MMM iii and
MMM
iii
MMM
iii
bed
bedOP2mo ago
wait are you suggesting that my comic sans font is what might be causing this
dan1st
dan1st2mo ago
yes
bed
bedOP2mo ago
oh my god it all makes sense now
ayylmao123xdd
ayylmao123xdd2mo ago
whats the font name monoscape right for it
bed
bedOP2mo ago
the font i use is comic sans
dan1st
dan1st2mo ago
teletype fonts are useful here
bed
bedOP2mo ago
i changed it for jokes and didnt realise it could affect code are teletype fonts ones that dont change
ayylmao123xdd
ayylmao123xdd2mo ago
would monoscape work in this case
dan1st
dan1st2mo ago
yes
bed
bedOP2mo ago
ah alright
dan1st
dan1st2mo ago
teletype = monospace mostly
bed
bedOP2mo ago
you're a life saver man thank you so much
JavaBot
JavaBot2mo 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
bedOP2mo ago
you don't want to know how long i spent with that appreciate u
ayylmao123xdd
ayylmao123xdd2mo ago
fun fact lego star wars uses monoscape
bed
bedOP2mo ago
thats cool
JavaBot
JavaBot2mo ago
Post Closed
This post has been closed by <@1167522887947796590>.

Did you find this page helpful?