to_html for a row-wise empty dataframe should print the header · Issue #6062 · pandas-dev/pandas (original) (raw)
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)
.