title: pyfpdf write_html In-line CSS style attribute not working in fpdf python
body: <p>I am trying to create a PDF file by using pyfpdf in python Django. the following code snippet I am trying to generate the pdf of HTML code and I am using the in-line CSS, but it not rendering the css style</p>
  
  <pre><code>from fpdf import FPDF, HTMLMixin
  import os
  
  class WriteHtmlPDF(FPDF, HTMLMixin):
      pass
  
  pdf = WriteHtmlPDF()
  # First page
  pdf.add_page()
  
  html = f"""&lt;h3&gt;xxxxx&lt;/h3&gt;
   &lt;div style="border:1px solid #000"&gt;
       &lt;table border="1" cellpadding="5" cellspacing="0"&gt;
           &lt;tr&gt;&lt;th width=20 align="left"&gt;xxxxxxxx:&lt;/th&gt;&lt;td width="100"&gt;xxxxxxxx&lt;/td&gt;&lt;/tr&gt;
           &lt;tr&gt;&lt;th width=20 align="left"&gt;xxxxxxxx:&lt;/th&gt;&lt;td width="100"&gt;xxxxxxxxx&lt;/td&gt;&lt;/tr&gt;
           &lt;tr&gt;&lt;th width=20 align="left"&gt;xxxxxxxx:&lt;/th&gt;&lt;td width="100"&gt;xxxxxxxxx&lt;/td&gt;&lt;/tr&gt;
           &lt;tr&gt;&lt;th width=20 align="left"&gt;xxxxxxxx:&lt;/th&gt;&lt;td width="100"&gt;xxxxxxxxx&lt;/td&gt;&lt;/tr&gt;
       &lt;/table&gt;
   &lt;/div&gt;
   &lt;div style="border: 1px solid; padding: 2px; font-size: 12px;"&gt;
       &lt;table&gt;
           &lt;tr&gt;
               &lt;td width="20"&gt;xxxxxx: 1&lt;/td&gt;
               &lt;td width="20"&gt;xxxxxx: 0&lt;/td&gt;
               &lt;td width="20"&gt;xxxxxx: 1&lt;/td&gt;
           &lt;/tr&gt;
       &lt;/table&gt;
   &lt;/div&gt;"""
  </code></pre>
  
  <p>PDF file get generated but without the CSS styling.</p>