code: def fitreport_html_table(result, show_correl=True, min_correl=0.1):
      """Generate a report of the fitting result as an HTML table.
  
      Parameters
      ----------
      result : MinimizerResult or ModelResult
          Object containing the optimized parameters and several
          goodness-of-fit statistics.
      show_correl : bool, optional
          Whether to show list of sorted correlations (default is True).
      min_correl : float, optional
          Smallest correlation in absolute value to show (default is 0.1).
  
      Returns
      -------
      str
          Multi-line HTML code of fit report.
  
      """
      html = []
      add = html.append
  
      def stat_row(label, val, val2=None, cat="td"):
          if val2 is None:
              rows = trow([label, val], cat=cat)
          else:
              rows = trow([label, val, val2], cat=cat)
          add(f"<tr>{''.join(rows)}</tr>")
  
      add('<table class="jp-toc-ignore">')
      add('<caption class="jp-toc-ignore">Fit Statistics</caption>')
      stat_row("fitting method", result.method)
      stat_row("# function evals", result.nfev)
      stat_row("# data points", result.ndata)
      stat_row("# variables", result.nvarys)
      stat_row("chi-square", gformat(result.chisqr))
      stat_row("reduced chi-square", gformat(result.redchi))
      stat_row("Akaike info crit.", gformat(result.aic))
      stat_row("Bayesian info crit.", gformat(result.bic))
      if hasattr(result, "rsquared"):
          stat_row("R-squared", gformat(result.rsquared))
      add("</table>")
      add(params_html_table(result.params))
      if show_correl:
          correls = []
          parnames = list(result.params.keys())
          for i, name in enumerate(result.params):
              par = result.params[name]
              if not par.vary:
                  continue
              if hasattr(par, "correl") and par.correl is not None:
                  for name2 in parnames[i + 1 :]:
                      if (
                          name != name2
                          and name2 in par.correl
                          and abs(par.correl[name2]) > min_correl
                      ):
                          correls.append(
                              (name, name2, par.correl[name2])
                          )
          if len(correls) > 0:
              sort_correls = sorted(
                  correls, key=lambda val: abs(val[2])
              )
              sort_correls.reverse()
              extra = f"(unreported values are < {min_correl:.3f})"
              add('<table class="jp-toc-ignore">')
              add(f"<caption>Correlations {extra}</caption>")
              stat_row(
                  "Parameter1", "Parameter 2", "Correlation", cat="th"
              )
              for name1, name2, val in sort_correls:
                  stat_row(name1, name2, f"{val:+.4f}")
              add("</table>")
      return "".join(html)
  
file_path: lmfit-py/lmfit/printfuncs.py
imports: from math import log10
  import re
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: fitreport_html_table(result, show_correl, min_correl) and returns: str