docstr: To handle nested tables, we will parse tables manually as follows:
  Get table soup
  Create docx table
  Iterate over soup and fill docx table with new instances of this parser
  Tell HTMLParser to ignore any tags until the corresponding closing table tag
docstr_tok: ["To","handle","nested","tables",",","we","will","parse","tables","manually","as","follows",":","Get","table","soup","Create","docx","table","Iterate","over","soup","and","fill","docx","table","with","new","instances","of","this","parser","Tell","HTMLParser","to","ignore","any","tags","until","the","corresponding","closing","table","tag"]
code: def handle_table(self, html, doc):
      """
      To handle nested tables, we will parse tables manually as follows:
      Get table soup
      Create docx table
      Iterate over soup and fill docx table with new instances of this parser
      Tell HTMLParser to ignore any tags until the corresponding closing table tag
      """
      table_soup = BeautifulSoup(html, "html.parser")
      rows, cols_len = get_table_dimensions(table_soup)
      table = doc.add_table(len(rows), cols_len)
      table.style = doc.styles["Table Grid"]
  
      cell_row = 0
      for index, row in enumerate(rows):
          cols = get_table_columns(row)
          cell_col = 0
          for col in cols:
              if cell_col >= cols_len:
                  break
  
              colspan = int(col.attrs.get("colspan", 1))
              rowspan = int(col.attrs.get("rowspan", 1))
              cell_html = get_cell_html(col)
              if col.name == "th":
                  cell_html = "<b>%s</b>" % cell_html
  
              docx_cell = table.cell(cell_row, cell_col)
              if (cell_col + colspan - 1) >= cols_len:
                  colspan -= 1
  
              cell_to_merge = table.cell(
                  cell_row + rowspan - 1, cell_col + colspan - 1
              )
              if docx_cell != cell_to_merge:
                  docx_cell.merge(cell_to_merge)
  
              child_parser = HtmlToDocx()
              child_parser.copy_settings_from(self)
              child_parser.add_html_to_cell(cell_html or " ", docx_cell)
  
              cell_col += colspan
          cell_row += 1
  
imports: import re
  import docx
  from docx import Document
  from bs4 import BeautifulSoup
  from html.parser import HTMLParser
label_desc: Use image node_id 9 for calling the HtmlToDocx obj's underlying member method code with example usage: obj.handle_table(html, doc) without return types