title: Set column width for table in pdf using itextsharp in c# mvc
body: <p>I have a table in MVC View</p>
  
  <pre><code>&lt;table class="table" border="1"&gt;
          &lt;tr&gt;
              &lt;th width="25%"&gt;
                  &lt;span&gt;&lt;b&gt;Statement Id&lt;/b&gt;&lt;/span&gt;
              &lt;/th&gt;
              &lt;th width ="75%"&gt;
                  &lt;span&gt;&lt;b&gt;Statements&lt;/b&gt;&lt;/span&gt;
              &lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td width="25%"&gt;
                  &lt;span&gt;&lt;b&gt;1&lt;/b&gt;&lt;/span&gt;
              &lt;/td&gt;
              &lt;td width ="75%"&gt;
                  &lt;span&gt;&lt;b&gt;Statement&lt;/b&gt;&lt;/span&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I am rendering this view to string and then string to pdf of this view using itextsharp.
  I want to change width of first column in table. How can i do this as i can not apply any css on this.</p>
  
  <p>This is my code to generate pdf</p>
  
  <pre><code>string htmlToConvert = RenderViewAsString("detailsPdfGenerate", row);
  pdfPage page = new pdfPage();
  iTextSharp.text.Document document = new iTextSharp.text.Document(iTextSharp.text.PageSize.LETTER);
  document.SetMargins(100f,50f,70f,40f);
  MemoryStream memStream = new MemoryStream();
  iTextSharp.text.pdf.PdfWriter pdfWriter=iTextSharp.text.pdf.PdfWriter.GetInstance(document, memStream);
  pdfWriter.PageEvent = page;
  document.Open();
  iTextSharp.text.html.simpleparser.StyleSheet styles = new iTextSharp.text.html.simpleparser.StyleSheet();
  iTextSharp.text.html.simpleparser.HTMLWorker hw = new iTextSharp.text.html.simpleparser.HTMLWorker(document);
  hw.Parse(new StringReader(htmlToConvert));
  document.Close();
  </code></pre>