C# reading a file and display in a table
<p>My objective is to read a text file and display the content in a table.
I have been through a lot of forum and goggling and still couldnt find a solution.</p>

<p>My Table format:</p>

<pre><code>&lt;table &gt;

   &lt;`tr&gt;

      &lt;`td&gt;

         Australia

      &lt;`/td&gt;

      &lt;`td&gt;

         &lt;`table&gt;

            &lt;`tr&gt;

               &lt;`td&gt;

                  1

               &lt;`/td&gt;

            &lt;`/tr&gt;

         &lt;`/table&gt;

       &lt;`/tr&gt;

&lt;`/table&gt;
</code></pre>

<p>My TextFile look like:</p>

<pre><code>Australia = 1,1,2,2

Malaysia = 1,1,1,2,2,2

Singapore = 1,1,1,1,2,2,2,2
</code></pre>

<p>My Reading code:</p>

<pre><code>        string path = @"..\TestFile.txt";
        char token = ',';
        char token2 = '=';

        string[] lines = File.ReadAllLines(path);

        Response.Write("&lt;table&gt;");
        foreach (string line in lines)
        {
            string[] country = line.Split(token2);
            string[] image = line.Split(token);
            string row = "&lt;tr&gt;&lt;td&gt;" + country + "&lt;/td&gt;" +"&lt;table&gt;&lt;tr&gt;";
            Response.Write(row);
            for (int i = 0; i &lt; image.Length; i++)
            {   

                string row2 = "&lt;td&gt;" + image[i] +"&lt;/td&gt;";
                Response.Write(row2);
            }
            Response.Write("&lt;/tr&gt;&lt;/table&gt;");
        }
        Response.Write("&lt;/tr&gt;&lt;/table&gt;");
</code></pre>

<p>my result:</p>

<pre><code>System.String[]
Australia = 1   1   2   2
System.String[]
Malaysia = 1    1   1   2   2   2
System.String[]
Singapore = 1   1   1   1   2   2   2   2
</code></pre>

<p>and what i want to achieve :</p>

<pre><code>Australia    1     1    2    2

Malaysia     1     1    1    2    2    2

Singapore    1     1    1    1    2    2    2    2
</code></pre>

<p>any help would be appreciated . Thanks!</p>
