def to_html(df, css=None):
    """
    Return a pandas table HTML representation with the datagrid css.
    Examples
    --------
    >>> from IPython.display import HTML
    >>> from pandas import DataFrame
    >>> df = DataFrame(np.empty((5, 5)))
    >>> html = to_html(df)
    >>> isinstance(html, HTML)
    True

    """
    from IPython.display import HTML
    if css:
        style = f'<style>{css}</style>'
    else:
        style = ''
    table = {'style': style, 'table': df.to_html()}
    return HTML(f'{style}<div class="datagrid">{table}</div>')
