title: How to align cell vertically with RowSpan>1
body: <p>I want to have this <img src="https://i.stack.imgur.com/NSMGa.gif" alt="enter image description here">,
     but instead have this <img src="https://i.stack.imgur.com/LQ877.gif" alt="enter image description here">.
     Please note, when I change <strong>VerticalAlign.Middle</strong> to <strong>VerticalAlign.Top</strong> it actually works as expected.
     Please see below code that I am trying:</p>
  
  <pre><code>   // I assume that table table is already created and well-defined  
     // Create a new row
  
      TableRow tRow = new TableRow();
  
      tRow.HorizontalAlign = HorizontalAlign.Center;
  
      // add the row to the table
  
      table.Rows.Add(tRow);
  
      // Create a new cell
  
      TableCell tCell = new TableCell();
  
      tCell.VerticalAlign = VerticalAlign.Middle; // Want to get it in the middle of two merged rows
  
      tCell.RowSpan = 2;
  
      tCell.Text = "England";
  
      tCell.Font.Bold = true;
  
      tRow.Cells.Add(tCell);
  
      // Create new cell
  
      tCell = new TableCell();
  
      tCell.Text = "2010";
  
      tCell.Font.Bold = true;
  
      tRow.Cells.Add(tCell);
  
      // Create new row
  
      tRow = new TableRow();
  
      // add the row to the table
  
      table.Rows.Add(tRow);
  
      // Create new cell
  
      tCell = new TableCell();
  
      tCell.Text = "2011";
  
      tCell.Font.Bold = true;
  
      tRow.Cells.Add(tCell);
  </code></pre>
  
  <p>Update: Please see extra code below. I don't have html code as such, but I looked at <strong>sw.ToString()</strong> and formatting looks right but still excel file does not seem to be rightly formatted. My browser is IE but I think it does not matter.
  I tried  <strong>tCell.CssClass = "className";</strong> result is the same.</p>
  
  <pre><code>public static void Comparison_Report(string fileName)
  {
  HttpContext.Current.Response.Clear();
  HttpContext.Current.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", fileName));
  HttpContext.Current.Response.ContentType = "application/ms-excel";
  using (StringWriter sw = new StringWriter())
  {
  using (HtmlTextWriter htw = new HtmlTextWriter(sw))
  {
  // Create a table to contain the grid
  Table table = new Table();
  
  ///----- Original code goes here----
  
  // render the table into the htmlwriter
  table.RenderControl(htw);
  // render the htmlwriter into the response  
  HttpContext.Current.Response.Write(sw.ToString());
  HttpContext.Current.Response.End();
  }
  
  }
  
  }
  </code></pre>