title: Getting the InnerHtml of an HTMLTable C#
body: <p>This function is returning an HTML table:</p>
  
  <pre><code>private HtmlTable ConvertToHtml(DataTable dataTable)
          {
              var htmlTable = new HtmlTable();
              if (dataTable == null) return htmlTable; //null reference, empty table
  
              HtmlTableRow htmlRow = new HtmlTableRow();
              htmlTable.Rows.Add(htmlRow);
  
              foreach (DataColumn column in dataTable.Columns)
                  htmlRow.Cells.Add(new HtmlTableCell() { InnerText = column.ColumnName });
  
              foreach (DataRow row in dataTable.Rows)
              {
                  htmlRow = new HtmlTableRow();
                  htmlTable.Rows.Add(htmlRow);
  
                  foreach (DataColumn column in dataTable.Columns)
                      htmlRow.Cells.Add(new HtmlTableCell() { InnerText = row[column].ToString() });
              }
  
              return htmlTable;
          }
  </code></pre>
  
  <p>I would like to know how I can get the <code>innerHTML</code> of <code>HtmlTable</code>.</p>
  
  <p>Currently, I am doing this:</p>
  
  <pre><code>        var bodyhtml = ConvertToHtml(r.tblSalesVolume);
          MessageBox.Show(bodyhtml.InnerHtml);
  </code></pre>
  
  <p>but it says that it doesn't have such a property.</p>
  
  <p>How do I get the HTML code for the table?</p>