I have ‘n’ after > and spaces before <. Is there a way to don’t save them when I call to_html method?
I have:
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
I want to have:
<table border="1" class="dataframe"><thead><tr style="text-align: right;">
I tried escape=False
, sparsify=True
, justify='center'
but it didn’t work.
2
Answers
You cannot do this with pandas alone, but it’s easy to post-process the string to remove the newlines and following spaces:
Output:
You can try package
minify-html
:Prints: