0

I am exporting pandas dataframe as table in html , exported to outlook. The table appears fine but the double cell borders are not good, I want a single line border, check the attached screenshot and code. enter image description here

df[['Col1','col2']].to_html( header=True, index=False, na_rep='NaN', formatters=None,  sparsify=None, index_names=True, justify=None,  classes=None, notebook=False, border=1, table_id=None)

1 Answer 1

1

You can replace border 1 to 0 if you must use border.

to_html().replace('border="1"','border="0"')

However, the border attribute is not supported in HTML5. Use CSS instead. This post would be ideal for you.

Sign up to request clarification or add additional context in comments.

2 Comments

This is same as making border=0 in above code, output is no border at all
Yes. Forget border in is no longer part of the HTML5 standard. Use CSS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.