I am referencing this answer trying to print a pretty table to the console: How to print well-formatted tables to the console?
Here is my code:
fn main() {
println!(
"{0: <15} | {1: <15} | {2: <50}",
"type", "human readable", "uuid id"
);
let characters = [
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '\n',
];
for c in characters {
println!(
"{0:<15} | {1:<15} | {2:<50}",
"char",
c.escape_debug(),
"asdfasdfdf"
);
}
}
Playground link.
As you can see in the playground, the table is not formatted properly. What am I doing wrong here? Why is the answer in the other question formatted correctly but mines isn't?