Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4036241

Browse files
authored
Merge pull request #10274 from timhoffm/css-table-in-field-list
doc: fix layout of tables within parameter lists
2 parents d07de22 + 912eb50 commit 4036241

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

doc/_static/mpl.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,20 @@ table.docutils {
582582
background-color: #eff3f4;
583583
}
584584

585+
/* tables inside parameter descriptions */
586+
td.field-body table.property-table {
587+
width: 100%;
588+
}
589+
590+
td.field-body table.property-table th {
591+
padding: 2px 10px;
592+
border: 0;
593+
}
594+
595+
td.field-body table.property-table td {
596+
padding: 2px 10px;
597+
}
598+
585599
/* function and class description */
586600
.descclassname {
587601
color: #aaa;
@@ -638,6 +652,9 @@ dl.class {
638652
font-family: monospace;
639653
}
640654

655+
table.docutils.field-list {
656+
width: 100%;
657+
}
641658

642659
.docutils.field-list th {
643660
background-color: #eee;

lib/matplotlib/artist.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,12 @@ def pprint_setters_rest(self, prop=None, leadingspace=2):
12811281

12821282
col0_len = max(len(n) for n in names)
12831283
col1_len = max(len(a) for a in accepts)
1284+
1285+
lines.append('')
1286+
lines.append(pad + '.. table::')
1287+
lines.append(pad + ' :class: property-table')
1288+
pad += ' '
1289+
12841290
table_formatstr = pad + '=' * col0_len + ' ' + '=' * col1_len
12851291

12861292
lines.append('')

0 commit comments

Comments
 (0)