ASP.NET Grid with CSS in Rows and Columns
<p>I have the following code</p>

<pre><code>List&lt;Department&gt; depts = new List&lt;Department&gt;();

Department.Add(new Department() { DNo = 1, DName = "Accounting", DFloor="6" });
Department.Add(new Department() { DNo = 2, DName = "FInance", DFloor="3" });
</code></pre>

<p>I want to bind this data to a GridView, so that it outputs the following. Observe the classes on each th and tr. How can I achieve this in ASP.NET?</p>

<pre><code>&lt;thead&gt;
&lt;tr&gt;
 &lt;th class="DNo"&gt;DNo&lt;/th&gt;
 &lt;th class="DName"&gt;DName&lt;/th&gt;
 &lt;th class= "DFloor"&gt;DFloor&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tr&gt;
 &lt;td class="DNo"&gt;1&lt;/td&gt;
 &lt;td class="DName"&gt;Accounting&lt;/td&gt;
 &lt;td class="DFloor"&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
 &lt;td class="DNo"&gt;2&lt;/td&gt;
 &lt;td class="DName"&gt;FInance&lt;/td&gt;
 &lt;td class="DFloor"&gt;3&lt;/td&gt;
&lt;/tr&gt;
</code></pre>
