Selaa lähdekoodia

Use div.vtable for vertical tables, and float them at right side.

Heikki Hokkanen 18 vuotta sitten
vanhempi
commit
e7eeb8973b
2 muutettua tiedostoa jossa 12 lisäystä ja 6 poistoa
  1. 6
    6
      statgit
  2. 6
    0
      statgit.css

+ 6
- 6
statgit Näytä tiedosto

@@ -310,7 +310,7 @@ class HTMLReportCreator(ReportCreator):
310 310
 		# TODO show also by hour of weekday?
311 311
 		f.write('\n<h2>Day of Week</h2>\n\n')
312 312
 		day_of_week = data.getActivityByDayOfWeek()
313
-		f.write('<table>')
313
+		f.write('<div class="vtable"><table>')
314 314
 		f.write('<tr><th>Day</th><th>Total (%)</th></tr>')
315 315
 		fp = open(path + '/day_of_week.dat', 'w')
316 316
 		for d in range(0, 7):
@@ -322,16 +322,16 @@ class HTMLReportCreator(ReportCreator):
322 322
 			else:
323 323
 				f.write('<td>0</td>')
324 324
 			f.write('</tr>')
325
-		f.write('</table>')
325
+		f.write('</table></div>')
326 326
 		f.write('<img src="day_of_week.png" />')
327 327
 		fp.close()
328 328
 
329 329
 		# Commits by year/month
330 330
 		f.write('<h2>Commits by year/month</h2>')
331
-		f.write('<table><tr><th>Month</th><th>Commits</th></tr>')
331
+		f.write('<div class="vtable"><table><tr><th>Month</th><th>Commits</th></tr>')
332 332
 		for yymm in reversed(sorted(data.commits_by_month.keys())):
333 333
 			f.write('<tr><td>%s</td><td>%d</td></tr>' % (yymm, data.commits_by_month[yymm]))
334
-		f.write('</table>')
334
+		f.write('</table></div>')
335 335
 		f.write('<img src="commits_by_year_month.png" />')
336 336
 		fg = open(path + '/commits_by_year_month.dat', 'w')
337 337
 		for yymm in sorted(data.commits_by_month.keys()):
@@ -340,10 +340,10 @@ class HTMLReportCreator(ReportCreator):
340 340
 
341 341
 		# Commits by year
342 342
 		f.write('<h2>Commits by year</h2>')
343
-		f.write('<table><tr><th>Year</th><th>Commits (% of all)</th></tr>')
343
+		f.write('<div class="vtable"><table><tr><th>Year</th><th>Commits (% of all)</th></tr>')
344 344
 		for yy in reversed(sorted(data.commits_by_year.keys())):
345 345
 			f.write('<tr><td>%s</td><td>%d (%.2f%%)</td></tr>' % (yy, data.commits_by_year[yy], (100.0 * data.commits_by_year[yy]) / data.getTotalCommits()))
346
-		f.write('</table>')
346
+		f.write('</table></div>')
347 347
 		f.write('<img src="commits_by_year.png" />')
348 348
 		fg = open(path + '/commits_by_year.dat', 'w')
349 349
 		for yy in sorted(data.commits_by_year.keys()):

+ 6
- 0
statgit.css Näytä tiedosto

@@ -80,3 +80,9 @@ img {
80 80
 	padding: 0.5em;
81 81
 	background-color: white;
82 82
 }
83
+
84
+.vtable {
85
+	float: right;
86
+	clear: both;
87
+	font-size: 90%;
88
+}