title: Parsing HTML snippets and adding to PdfPTable
body: <p>I am creating a PDF made of several PdfPTables where some PdfCell's consist of simple Phrases and others need to be parsed HTML snippets. To make sure the parsed HTML is added with the needed styling and in the correct place I have been storing it in a Paragraph then adding it to a PdfPCell. However doing this causes me to run into issues when dealing with some HTML tags like lists and quotes. Below is a rough example of what I am doing, what can I do to properly handle HTML lists, quotes, etc. ?</p>
  
  <p>For example: iText properly handles a HTML list and knows to convert it to an iText List/ListItem. I need to add that List into my PdfTable. I know putting the List Element in a Paragraph cancels out the proper styling (the entire list ends up being on one line with no numbering) and would like to know the proper way of handling this </p>
  
  <pre><code>PdfPTable table = new PdfPTable(1);
      table.addCell(parseHtmlToParagraph(htmlString));
      table.addCell(new Phrase("Name" + user.getName()));
  </code></pre>
  
  <hr>
  
  <pre><code>public Paragraph parseHtmlToParagraph(String str) throws IOException {
      StringReader body = new StringReader(str);
      final Paragraph para = new Paragraph();
  
      XMLWorkerHelper.getInstance().parseXHtml(new ElementHandler() {
          @Override
          public void add(Writable w) {
              if (w instanceof WritableElement) {
                  List&lt;Element&gt; elements = ((WritableElement) w).elements();
                  for (Element e : elements) {
                      para.add(e);
                  }
              }
          }
      }, body);
  
      return para;
  }
  </code></pre>