How to align strings in C# using string.Format() function?
<p>Output is to the word document (docx).</p>

<p>I would like to make outuput like this using C# 4.0 string.Format:</p>

<pre><code>string1: stringValue1,  string2:stringValue2
string4: stringValue4,  string5:stringValue5
string6: stringValue6,  string7:stringValue7
string8: stringValue8,  string9:stringValue9
</code></pre>

<p>I am using <code>string.Format("{0,-10} {1,-10}",string1,string2)</code> but it does nothing. Is there a way how to align strings using string.Format()? I saw '\t' solution but how to add it into string.Fornmat()?</p>

<p>Here is my code and my output:</p>

<pre><code>string titel = HttpUtility.HtmlEncode(docItem.Title);
                    string href = docItem.FullURL;
                    string title = string.Format("{0}", titel);
                    string author = docItem.Author;
                    string date = docItem.ChangedDate.Date.ToShortDateString();
                    CreateTextBoxConentParagraph(doc, string.Format("Title: &lt;a href='{0}'&gt;{1}&lt;/a&gt; Author: {2} Geändert an: {3}",href,title.PadRight(20),author.PadRight(20), date),string.Format("chunkId_{0}", i++));
</code></pre>

<p>Output:
Title: Author: aaa Geändert an: 19.04.2013</p>

<p>Title: second Author: aaa Geändert an: 18.04.2013</p>

<p>Title: slika Author: aaa Geändert an: 18.04.2013</p>

<p>Title: d m Author: aaa Geändert an: 18.04.2013</p>

<p>Title: Mathias Author: aaa Geändert an: 19.04.2013</p>

<p>Title: QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQqq Author: aaa Geändert an: 19.04.2013</p>
