home · contact · privacy
Minor CSS refactor.
[berlin-corona-table] / enhance_table.py
index 785e231a681b8f0862fa206eeaf1fc80c7c42faf..a969895164f6a316123e1692d32762248533c15c 100755 (executable)
@@ -134,20 +134,21 @@ if output_type == 'html':
     print('<html>')
     print('<style>')
     print('table, tr, th, td { border: 1px solid black; }')
-    print('tr:nth-child(7n+2) td { background-color: yellow; }')
+    print('.day_row:nth-child(7n+2) { background-color: yellow; }')
+    print('.district_header { writing-mode: vertical-rl; '
+          'transform: rotate(180deg); }')
     print('</style>')
     print('<table>')
     print('<tr>')
     print('<th>date</th>')
     for district in sorted_districts:
         long_form = translate[district]
-        print('<th style="writing-mode: vertical-rl; '
-              'transform: rotate(180deg);">%s</th>' % long_form)
+        print('<th class="district_header">%s</th>' % long_form)
     print('</tr>')
     sorted_dates.reverse()
     sum_district = sorted_districts[-1]
     for date in sorted_dates:
-        print('<tr>')
+        print('<tr class="day_row">')
         print('<td>%s</td>' % date)
         long_wsum = translate['wsum']
         long_wavg = translate['wavg']