Skip to content

to_html for a row-wise empty dataframe should print the header #6062

Closed
@filmor

Description

@filmor

I'd expect the output of

pd.DataFrame(columns=["asdf", "bsdf"]).to_html()

to be essentially <th>asdf</th><th>bsdf</th> as an html table. This would be a lot more homogeneous. The current output is pretty useless, being basically repr(df).

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