docs: def render_template(table_headers, table_items, **options):
      """
      Render Jinja2 template
      """
      caption = options.get("caption") or "Table"
      display_length = options.get("display_length") or -1
      height = options.get("height") or "70vh"
      default_length_menu = [-1, 10, 25, 50]
      pagination = options.get("pagination")
      virtual_scroll_limit = options.get("virtual_scroll")
  
      # Change % to vh
      height = height.replace("%", "vh")
  
      # Header columns
      columns = []
      for header in table_headers:
          columns.append({"title": header})
  
      # Data table options
      datatable_options = {
          "columns": columns,
          "data": table_items,
          "iDisplayLength": display_length,
          "sScrollX": "100%",
          "sScrollXInner": "100%"
      }
  
      # Enable virtual scroll for rows bigger than 1000 rows
      is_paging = pagination
      virtual_scroll = False
      scroll_y = height
  
      if virtual_scroll_limit:
          if virtual_scroll_limit != -1 and len(table_items) > virtual_scroll_limit:
              virtual_scroll = True
              display_length = -1
  
          fmt = ("\nVirtual scroll is enabled since number of rows exceeds {limit}."
                 " You can set custom row limit by setting flag -vs, --virtual-scroll."
                 " Virtual scroll can be disabled by setting the value to -1 and set it to 0 to always enable.")
          logger.warn(fmt.format(limit=virtual_scroll_limit))
  
          if not is_paging:
              fmt = "\nPagination can not be disabled in virtual scroll mode."
              logger.warn(fmt)
  
          is_paging = True
  
      if is_paging and not virtual_scroll:
          # Add display length to the default display length menu
          length_menu = []
          if display_length != -1:
              length_menu = sorted(default_length_menu + [display_length])
          else:
              length_menu = default_length_menu
  
          # Set label as "All" it display length is -1
          length_menu_label = [str("All") if i == -1 else i for i in length_menu]
          datatable_options["lengthMenu"] = [length_menu, length_menu_label]
          datatable_options["iDisplayLength"] = display_length
  
      if is_paging:
          datatable_options["paging"] = True
      else:
          datatable_options["paging"] = False
  
      if scroll_y:
          datatable_options["scrollY"] = scroll_y
  
      if virtual_scroll:
          datatable_options["scroller"] = True
          datatable_options["bPaginate"] = False
          datatable_options["deferRender"] = True
          datatable_options["bLengthChange"] = False
  
      enable_export = options.get("export")
      if enable_export:
          if options["export_options"]:
              allowed = list(options["export_options"])
          else:
              allowed = ["copy", "csv", "json", "print"]
  
          datatable_options["dom"] = "Bfrtip"
          datatable_options["buttons"] = allowed
  
      datatable_options_json = json.dumps(datatable_options,
                                          separators=(",", ":"))
  
      return template.render(title=caption or "Table",
                             caption=caption,
                             datatable_options=datatable_options_json,
                             virtual_scroll=virtual_scroll,
                             enable_export=enable_export)