I think we need more information.
For example, you could pad the lines with spaces at the end or the front.
Another choice is to expand the column width for each column to some max size, padding each column to that size.
What result do you need?
This pads spaces at the end:
Above two suggestions are good and solve the question specifically, but if you need a variation with your end-of-line characters (like a zero or other strings), then this is conceptually simple and modifiable