title: ASP.NET - How to set Cells-Width-Percentage on C# Table
body: <p>Hellooo, everyone! I have a <strong>System.Web.UI.WebControls.Table</strong> with cells(controls) with Width (20% by default). I want to change this Percentage -> 40% / 20% / 20% / 10% / 10%</p>
  
  <p><strong>I want following:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/myayM.png" rel="noreferrer"><img src="https://i.stack.imgur.com/myayM.png" alt="enter image description here"></a></p>
  
  <p>How  to set different <strong>Width</strong> on this cells(controls)?</p>
  
  <p><strong>This is my code:</strong></p>
  
  <pre><code>Table myTbl = new Table();
  TableRow tRow1 = new TableRow();
  
      //Row1 Cells Controls
  
              TextBox txt11 = new TextBox();
              txt11.ID = "txtDest11";
              txt11.Height = 19;
             //txt11.Width = Unit.Percentage(40);
  
              TextBox txt12 = new TextBox();
              txt12.ID = "txtKmInCity12";
              txt12.Height = 19;
  
              TextBox txt13 = new TextBox();
              txt13.ID = "txtKmOutCity13";
              txt13.Height = 19;
  
              DateTimeControl dt11 = new DateTimeControl();
              dt11.DateOnly = true;
              dt11.ShowWeekNumber = true;
              dt11.LocaleId = 1026;
  
              DateTimeControl dt12 = new DateTimeControl();
              dt12.DateOnly = true;
              dt12.ShowWeekNumber = true;
              dt12.LocaleId = 1026;
  
              tRow1 = new TableRow();
              tRow1.Visible = true;
  
              TableCell tCellZero = new TableCell();
              tCellZero.Controls.Add(rowNo);
              tRow1.Cells.Add(tCellZero);
  
              TableCell tCellOne = new TableCell();
              tCellOne.Controls.Add(txt11);
              tRow1.Cells.Add(tCellOne);
  
              TableCell tCellTwo = new TableCell();
              tCellTwo.Controls.Add(dt11);
              tRow1.Cells.Add(tCellTwo);
  
              TableCell tCellThree = new TableCell();
              tCellThree.Controls.Add(dt12);
              tRow1.Cells.Add(tCellThree);
  
              TableCell tCellFour = new TableCell();
              tCellFour.Controls.Add(txt12);
              tRow1.Cells.Add(tCellFour);
  
              TableCell tCellFive = new TableCell();
              tCellFive.Controls.Add(txt13);
              tRow1.Cells.Add(tCellFive);
  
              myTbl.Rows.Add(tRow1);
  </code></pre>
  
  <p><strong>Result :</strong> </p>
  
  <p><a href="https://i.stack.imgur.com/j6wqp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/j6wqp.png" alt="enter image description here"></a></p>