Add table id option to pandas.DataFrame.to_html · Issue #8496 · pandas-dev/pandas (original) (raw)

I'm using the pandas.DataFrame.to_html() method to generate a table to embed into a a templated document which references the table via an id. It would be useful if pandas.DataFrame.to_html() supported a table_id parameter:

df.to_html(table_id='myTable')

to produce:

<table border="1" class="dataframe" id='mytable'>