diff --git a/pandas/core/format.py b/pandas/core/format.py index c2f439877ca00..f344d4b009df9 100644 --- a/pandas/core/format.py +++ b/pandas/core/format.py @@ -711,6 +711,8 @@ def write_th(self, s, indent=0, tags=None): return self._write_cell(s, kind='th', indent=indent, tags=tags) def write_td(self, s, indent=0, tags=None): + if s == self.fmt.na_rep: + tags = (tags or "") + ' class="pandas-empty"' return self._write_cell(s, kind='td', indent=indent, tags=tags) def _write_cell(self, s, kind='td', indent=0, tags=None):