code: def table_from_df(df) -> str:
      """Generate a html table from a pandas DataFrame"""
  
      header_row = "\n".join(
          [f'      <th scope="col">{col}</th>' for col in df.columns]
      )
      body_rows = ""
      for i, row in df.iterrows():
          body_rows += (
              "    <tr>\n"
              + "\n".join(
                  [
                      "      <td>" + str(val) + "</td>"
                      for val in row.values
                  ]
              )
              + "\n    </tr>\n"
          )
  
      table = f"""
  <table class="table">
    <thead>
      <tr>
  {header_row}
      </tr>
    </thead>
    <tbody>
  {body_rows}
    </tbody>
  </table>
      """
      return table
  
file_path: explainerdashboard/explainerdashboard/to_html.py
label_desc: Use image node_id 11 for calling a global function with example usage: table_from_df(df) and returns: table