Skip to content

Commit ed45e6e

Browse files
clhamjreback
authored andcommitted
ENH: Corrects to_html print spacing GH4987
1 parent b3ff5eb commit ed45e6e

File tree

3 files changed

+196
-196
lines changed

3 files changed

+196
-196
lines changed

doc/source/whatsnew/v0.16.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ Bug Fixes
413413

414414
.. _whatsnew_0160.bug_fixes:
415415

416+
- Changed ``.to_html`` to remove leading/trailing spaces in table body (:issue:`4987`)
416417
- Fixed issue using ``read_csv`` on s3 with Python 3.
417418
- Fixed compatibility issue in ``DatetimeIndex`` affecting architectures where ``numpy.int_`` defaults to ``numpy.int32`` (:issue:`8943`)
418419
- Bug in Panel indexing with an object-like (:issue:`9140`)

pandas/core/format.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ def _write_cell(self, s, kind='td', indent=0, tags=None):
819819
)
820820
else:
821821
esc = {}
822-
rs = com.pprint_thing(s, escape_chars=esc)
822+
rs = com.pprint_thing(s, escape_chars=esc).strip()
823823
self.write(
824824
'%s%s</%s>' % (start_tag, rs, kind), indent)
825825

0 commit comments

Comments
 (0)