How to format a list of some classes into a nice ASCII table in C#?
<p>Have a LINQ result, need to format it in plain text nicely to send by email.</p>

<p>For example each record contains "ProductName", "SalesAmount", "Taxes"
And product names could be strings different length for different records.</p>

<p>Need to format a list of such records as plaintext table. Using "----------" as horizontal line and "|" as vertical line.</p>

<p>As you don't know the max size of product name you don't know the size of vertical line in characters for it. Suppose need to find the maximum product name length and depending on it calculate amount of "-" characters needed. But is there anything that can auto format?</p>

<p>Assuming that font is mono-spaced.</p>

<p>What is the best way to do it? </p>

<p>Thanks.</p>
