Skip to content

Commit d40a3ec

Browse files
committed
Changes
1 parent 7916599 commit d40a3ec

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pandas/core/frame.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,11 @@ def _repr_html_(self):
612612
max_rows = get_option("display.max_rows")
613613
max_cols = get_option("display.max_columns")
614614
show_dimensions = get_option("display.show_dimensions")
615+
classes = ['pandas_notebook']
615616

616617
return self.to_html(max_rows=max_rows, max_cols=max_cols,
617-
show_dimensions=show_dimensions, notebook=True)
618+
show_dimensions=show_dimensions, notebook=True,
619+
classes=classes)
618620
else:
619621
return None
620622

pandas/io/formats/format.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,8 @@ def _column_header():
11831183

11841184
if isinstance(self.columns, MultiIndex):
11851185
template = 'colspan="%d" halign="left"'
1186+
if 'pandas_notebook' in self.classes:
1187+
template += ' class="pandas_notebook"'
11861188

11871189
if self.fmt.sparsify:
11881190
# GH3547
@@ -1252,6 +1254,8 @@ def _column_header():
12521254
if records[i] > 1:
12531255
tags[j] = template % records[i]
12541256
else:
1257+
if 'pandas_notebook' in self.classes:
1258+
tags[j] = 'class="pandas_notebook"'
12551259
continue
12561260
j += 1
12571261
row.append(v)

0 commit comments

Comments
 (0)