title: Setting a css class for TD
body: <p>I am using a customized user control (that I don't have the permission to modify) which renders the HTML for a table as shown:</p>
  
  <pre><code>&lt;tr&gt;
    &lt;td&gt;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>It lets me add any control dynamically within the  tags. My question is how would I  set the style of the cell for the table cell. Normally, I would do <code>&lt;td class="myClass"&gt;</code>. Since I don't have the source code to modify it, the workaround I am using is to create a <code>&lt;div&gt;</code>, set the CSS class and add it to the <code>&lt;td&gt;</code>. The code looks something like this:</p>
  
  <pre><code>  HtmlGenericControl divControl = new HtmlGenericControl("div");
    divControl.Attributes.Add("class", "myClass");
    //Add a textbox to divControl.
    //Add the divControl to the customized user control
  </code></pre>
  
  <p>This does not give me the same UI I am expecting.</p>