【发布时间】:2020-07-12 07:44:10
【问题描述】:
我想为我的收据实现正确对齐,目前我可以像图片中那样对齐currently getting the receipt like this
为了实现正确对齐,我尝试了两种方法,在单行中,我尝试同时提及左对齐和右对齐,但这不起作用,因为 epson 不允许在同一行上对齐 然后我尝试在现金和金额之间添加空格,但有时由于描述较长,金额可能会向右更远,所以它不稳定,所以有人可以告诉我实现正确对齐的正确方法
self.receiptText += alignLeft + tndrDesc + "\n";
self.receiptText += alignRight + formatTdrAmt + "\n";
但上面的代码在金额上方的一行中给出了描述,但如果我不使用 \n 它将出现在同一行而不是右对齐
【问题讨论】:
标签: javascript html printers thermal-printer epson