ESC-POS-USB-NET
ESC-POS-USB-NET copied to clipboard
How to print a table?
A method to print tables could be very usefull!
If u know a very good way of printing something like a table please help me.
string.format & fields definitions (length/align/...) https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-string-format#get-started-with-the-stringformat-method
Use escape character "\t" like that
//Defiine Header
string table = "\tfooHeader\tbarHeader";
//Define Body
foreach(var item in items){
table += "\n\tfooItem\tbarItem"
}
printer.Append(table);