def _render_dataframe(dataframe):
  """Helper to render a dataframe as an HTML table."""
  data = dataframe.to_dict(orient='records')
  fields = dataframe.columns.tolist()
  return IPython.core.display.HTML(
      datalab.utils.commands.HtmlBuilder.render_table(data, fields))