title: Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text)
body: <p>I'm trying to build a TableLayoutPanel on a WinForm and want it to behave exactly like a plain old HTML table.  </p>
  
  <p>One requirement is that this table needs to be built programmatically.  This is what I have so far:</p>
  
  <pre><code>foreach (var RowLinq in ResultLinq)
  {
      RichTextBox RT = new RichTextBox();
      RT.BorderStyle = BorderStyle.None;
      RT.Text = RowLinq.Result.ResultName;
      RT.Dock = DockStyle.Fill;
  
      TableLayoutPanel.RowCount++;
      TableLayoutPanel.RowStyles.Add(new RowStyle(System.Windows.Forms.SizeType.AutoSize));
      TableLayoutPanel.Controls.Add(rt1, 0, tableLayoutPanel5.RowCount - 1);
  }
  </code></pre>
  
  <p>So this builds a row for each row in my Linq result.  This works pretty well except for one thing: the height doesn't adjust at all and is completely fixed.  I need the height to grow and shrink depending on the height of the text inside each cell.  </p>
  
  <p>I need your help with this one big time, thanks Stack-o</p>