Formatting a plain text e-mail in C#

两盒软妹~` 提交于 2019-12-02 08:23:20

Creating (or actually imitating the behaviour of) a table in plain text only works well when:

  1. The values in your tables are exactly the same width as the widht of the column. This is something you (the programmer) should take care of by trailing the text with spaces when the text is too short or cutting of the text if is too long.

  2. The user that is receiving the text is using a monospace font (http://en.wikipedia.org/wiki/Monospaced_font) to view the table. And that is unfortunately beyond your control if you send the table in an e-mail message...

That's due to fonts. If you want it to line up, you need to use a fixed width font like your code editor hopefully does.

Else you can attempt something using TAB's. But that can be tricky.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!