Skip to content

Add table id option to pandas.DataFrame.to_html  #8496

Closed
@psychemedia

Description

@psychemedia

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'>

Metadata

Metadata

Assignees

No one assigned

    Labels

    IO HTMLread_html, to_html, Styler.apply, Styler.applymapOutput-Formatting__repr__ of pandas objects, to_string

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions