code: def ui_table_from_df(
      q: Q,
      df: pd.DataFrame,
      name: str,
      sortables: list = None,
      filterables: list = None,
      searchables: list = None,
      markdown_cells=None,
      numerics: list = None,
      times: list = None,
      tags: list = None,
      progresses: list = None,
      min_widths: dict = None,
      max_widths: dict = None,
      link_col: str = None,
      multiple: bool = False,
      groupable: bool = False,
      downloadable: bool = False,
      resettable: bool = False,
      height: str = None,
      checkbox_visibility: str = None,
      actions: dict = None,
      max_char_length: int = 500,
      cell_overflow="tooltip",
  ) -> Component:
      """
      Convert a Pandas dataframe into Wave ui.table format.
      """
  
      df = df.reset_index(drop=True)
      sortables = sortables or []
      filterables = filterables or []
      searchables = searchables or []
      numerics = numerics or []
      times = times or []
      tags = tags or []
      progresses = progresses or []
      markdown_cells = markdown_cells or []
      min_widths = min_widths or {}
      max_widths = max_widths or {}
  
      cell_types = {}
      for col in tags:
          cell_types[col] = ui.tag_table_cell_type(
              name="tags",
              tags=[
                  ui.tag(label=state, color=wave_theme.states[state])
                  for state in wave_theme.states
              ],
          )
      for col in progresses:
          cell_types[col] = ui.progress_table_cell_type(
              wave_theme.get_primary_color(q),
          )
      for col in markdown_cells:
          # enables rendering of code in wave table
          cell_types[col] = ui.markdown_table_cell_type()
  
      columns = [
          ui.table_column(
              name=str(col),
              label=str(col),
              sortable=True if col in sortables else False,
              filterable=True if col in filterables else False,
              searchable=True if col in searchables else False,
              data_type="number"
              if col in numerics
              else ("time" if col in times else "string"),
              cell_type=cell_types[col] if col in cell_types else None,
              min_width=min_widths[col] if col in min_widths else None,
              max_width=max_widths[col] if col in max_widths else None,
              link=True if col == link_col else False,
              cell_overflow=cell_overflow,
          )
          for col in df.columns.values
      ]
  
      if actions:
          commands = [
              ui.command(name=key, label=val)
              for key, val in actions.items()
          ]
          action_column = ui.table_column(
              name="actions",
              label="action" if int(min_widths["actions"]) > 30 else "",
              cell_type=ui.menu_table_cell_type(
                  name="commands", commands=commands
              ),
              min_width=min_widths["actions"],
          )
          columns.append(action_column)
  
      rows = []
      for i, row in df.iterrows():
          cells = []
  
          for cell in row:
              str_repr = str(cell)
  
              if len(str_repr) >= max_char_length:
                  str_repr = str_repr[:max_char_length] + "..."
  
              cells.append(str_repr)
  
          rows.append(ui.table_row(name=str(i), cells=cells))
  
      table = ui.table(
          name=name,
          columns=columns,
          rows=rows,
          multiple=multiple,
          groupable=groupable,
          downloadable=downloadable,
          resettable=resettable,
          height=height,
          checkbox_visibility=checkbox_visibility,
      )
  
      return table
  
file_path: h2o-llmstudio/llm_studio/app_utils/wave_utils.py
imports: import subprocess
  import sys
  import traceback
  from typing import TypedDict
  import pandas
  from h2o_wave import Q, expando_to_dict, ui
  from h2o_wave.types import Component
  from llm_studio.app_utils.sections.common import clean_dashboard
  from .config import default_cfg
label_desc: Use image node_id 1 for calling a global function with example usage: ui_table_from_df(q, df, name, sortables, filterables, searchables, markdown_cells, numerics, times, tags, progresses, min_widths, max_widths, link_col, multiple, groupable, downloadable, resettable, height, checkbox_visibility, actions, max_char_length, cell_overflow) and returns: table