class_docstr: default setting for report constants
docstr: add a table into the pdf report
     (not support auto-text-swapping for now)
  
  Args:
      header (list(str)): table header
      data (list(list)): table data
      col_width (list(int)): column width.
                             Set to balanced column width if None.
      row_height (int): row height
      x (int): x position of current page
               to start the table (left top corner)
      y (int): y position of current page
               to start the table (left top corner)
docstr_tok: ["add","a","table","into","the","pdf","report","(","not","support","auto-text-swapping","for","now",")","Args",":","header","(","list","(","str",")",")",":","table","header","data","(","list","(","list",")",")",":","table","data","col_width","(","list","(","int",")",")",":","column","width",".","Set","to","balanced","column","width","if","None",".","row_height","(","int",")",":","row","height","x","(","int",")",":","x","position","of","current","page","to","start","the","table","(","left","top","corner",")","y","(","int",")",":","y","position","of","current","page","to","start","the","table","(","left","top","corner",")"]
code: def add_table(
      self, header, data, col_width=None, row_height=6, x=None, y=None
  ):
      """
      add a table into the pdf report
         (not support auto-text-swapping for now)
  
      Args:
          header (list(str)): table header
          data (list(list)): table data
          col_width (list(int)): column width.
                                 Set to balanced column width if None.
          row_height (int): row height
          x (int): x position of current page
                   to start the table (left top corner)
          y (int): y position of current page
                   to start the table (left top corner)
      """
      # Colors, line width and bold font
      self.set_fill_color(**CustomPdf.TABLE_HEADER_COLOR)
      self.set_text_color(**CustomPdf.DEFAULT_CONTEXT_FONT_COLOR)
      self.set_draw_color(**CustomPdf.TABLE_HEADER_COLOR)
      self.set_line_width(0.3)
      self.set_font("", "B")
  
      # Header
      if col_width is None:
          col_w = int(180 / len(header))
          w = [col_w] * len(header)
      else:
          w = col_width
      if y is not None:
          self.global_y = y
      for i in range(0, len(header)):
          if x is not None:
              self.global_x = x
          self.cell(w[i], row_height, header[i], 1, 0, "L", 1)
      self.ln()
      # Color and font restoration
      self.set_fill_color(**CustomPdf.TABLE_ROW_DARK_COLOR)
      self.set_text_color(**CustomPdf.TABLE_ROW_TEXT_COLOR)
      self.set_font("")
      # Data
      fill = 0
      for row in data:
          for i in range(len(data[0])):
              self.cell(
                  w[i], row_height, str(row[i]), "LR", 0, "L", fill
              )
          self.ln()
          fill = not fill
      self.cell(sum(w), 0, "", "T")
      self.add_new_line()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import warnings
  import datetime
  import re
  from fpdf import FPDF
label_desc: Use image node_id 12 for calling the CustomPdf obj's underlying member method code with example usage: obj.add_table(header, data, col_width, row_height, x, y) without return types