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

Skip to content

Commit 3b961c2

Browse files
committed
Update for an Issue #254
1 parent bdd819d commit 3b961c2

2 files changed

Lines changed: 21 additions & 12 deletions

File tree

lib/core/dump.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,7 @@ def dbTablesCount(self, dbTables):
326326
def dbTableValues(self, tableValues):
327327
replication = None
328328
rtable = None
329-
documentNode = None
330-
tableNode = None
331-
rowNode = None
329+
documentNode, tableNode, bodyNode, headNode, rowNode = (0,) * 5
332330
dumpFP = None
333331

334332
if tableValues is None:
@@ -411,8 +409,12 @@ def dbTableValues(self, tableValues):
411409
self._write(separator)
412410

413411
if conf.dumpFormat == DUMP_FORMAT.HTML:
412+
headNode = documentNode.createElement("thead")
414413
rowNode = documentNode.createElement("tr")
415-
tableNode.appendChild(rowNode)
414+
tableNode.appendChild(headNode)
415+
headNode.appendChild(rowNode)
416+
bodyNode = documentNode.createElement("tbody")
417+
tableNode.appendChild(bodyNode)
416418

417419
for column in columns:
418420
if column != "__infos__":
@@ -455,7 +457,7 @@ def dbTableValues(self, tableValues):
455457

456458
if conf.dumpFormat == DUMP_FORMAT.HTML:
457459
rowNode = documentNode.createElement("tr")
458-
tableNode.appendChild(rowNode)
460+
bodyNode.appendChild(rowNode)
459461

460462
for column in columns:
461463
if column != "__infos__":

lib/core/settings.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,21 @@
503503
# CSS style used in HTML dump format
504504
HTML_DUMP_CSS_STYLE = """<style>
505505
table{
506-
margin:10;
507-
background-color:#ffffff;
508-
font-family:verdana;
509-
font-size:12px;
510-
align:center;
506+
margin:10;
507+
background-color:#FFFFFF;
508+
font-family:verdana;
509+
font-size:12px;
510+
align:center;
511+
}
512+
thead{
513+
font-weight:bold;
514+
background-color:#4F81BD;
515+
color:#FFFFFF;
516+
}
517+
tr:nth-child(even) {
518+
background-color: #D3DFEE
511519
}
512520
td{
513-
font-family:verdana;
514-
font-size:10px;
521+
font-size:10px;
515522
}
516523
</style>"""

0 commit comments

Comments
 (0)