title: Create HTML table from a list
body: <p>I am trying to get some values from a List and then create a html table with this data but I can't get it to work properly.</p>
  <p>I have:</p>
  <pre class="lang-cs prettyprint-override"><code>HtmlTable table = new HtmlTable();
  HtmlTableRow row;
  HtmlTableCell cell;
  
  foreach(var item in Name)
  {
      row = new HtmlTableRow();
      
      foreach(var familyName in item.familyName)
      {
          cell = new HtmlTableCell();
          cell.InnerText = item.familyName.ToString();
          row.Cells.Add(cell);
      }
      
      foreach (var givenName in item.givenName)
      {
          cell = new HtmlTableCell();
          cell.InnerText = item.givenName.ToString();
          row.Cells.Add(cell);
      }
      
      table.Rows.Add(row);
  }
  
  this.Controls.Add(table);
  </code></pre>
  <p>When I step through the debugger I can see that row.Cells.Add(cell) contains the family name in the first loop and given name in the second loop but then something seems to be wrong and I can't get the table to show up on the page with this data.</p>
  <p>When I check the table.rows.add(row) it says that</p>
  <blockquote>
  <p>base {System.SystemException} = {&quot;'HtmlTableRow' does not support the InnerText property.&quot;}</p>
  </blockquote>
  <p>What am I doing wrong here?</p>