Skip to content

Commit 875a0e9

Browse files
author
y-p
committed
BUG: df.to_html() should respect col_space argument. #1000
1 parent f187a3a commit 875a0e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/core/format.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,11 @@ def write(self, s, indent=0):
434434
self.elements.append(' ' * indent + com.pprint_thing(s))
435435

436436
def write_th(self, s, indent=0, tags=None):
437+
if (self.fmt.col_space is not None
438+
and self.fmt.col_space > 0 ):
439+
tags = (tags or "" )
440+
tags += 'style="min-width: %s;"' % self.fmt.col_space
441+
437442
return self._write_cell(s, kind='th', indent=indent, tags=tags)
438443

439444
def write_td(self, s, indent=0, tags=None):

0 commit comments

Comments
 (0)