47 background-color:#252525;\n\
56 background-color:#AADD44;\n\
59 border:1px solid #555555;\n\
61 display:inline-block;\n\
66 font-family:\"Calibri\", \"Courier New\", \"Trebuchet MS\", Arial, Helvetica, sans-serif;\n\
70 border-collapse:collapse;\n\
72 table.params caption\n\
74 font-family:\"Courier New\", \"Trebuchet MS\", Arial, Helvetica, sans-serif;\n\
77 background-color:#000000;\n\
78 padding:4px 7px 4px 7px;\n\
80 table.params tr a { color:#FFFFFF; }\n\
81 table.params tr a:hover { color:#99DD66; }\n\
88 padding-bottom:4px;\n\
89 background-color:#AAAAAA;\n\
91 border:1px solid #999999;\n\
93 table.params td, th\n\
96 border:1px solid #CBCBCB;\n\
97 padding:3px 7px 2px 7px;\n\
98 background-color:#EBEBEB;\n\
100 table.params tr.alt td\n\
103 background-color:#DADADA;\n\
107 font-family:\"Calibri\", \"Courier New\", \"Trebuchet MS\", Arial, Helvetica, sans-serif;\n\
111 border-collapse:collapse;\n\
113 table.stats tr a { color:#DDDDFF; }\n\
114 table.stats tr a:hover { color:#99DD66; }\n\
115 table.stats td, th\n\
118 border:1px solid #BBBBBB;\n\
119 padding:3px 7px 2px 7px;\n\
120 background-color:#DDDDDD;\n\
122 table.stats td.small\n\
125 border:1px solid #BBBBBB;\n\
126 padding:3px 7px 2px 7px;\n\
128 table.stats td.smallpink\n\
131 padding:3px 7px 2px 7px;\n\
133 background-color:#FFE5D5;\n\
134 border:1px solid #BB9988;\n\
142 padding-bottom:4px;\n\
143 background-color:#444444;\n\
145 border:1px solid #383838;\n\
147 table.stats caption\n\
149 font-family:\"Courier New\", \"Trebuchet MS\", Arial, Helvetica, sans-serif;\n\
153 background-color:#000000;\n\
154 padding:12px 7px 4px 7px;\n\
156 table.stats tr.alt td\n\
159 background-color:#EAEAEA;\n\
161 table.stats tr.alt td.small\n\
165 background-color:#EAEAEA;\n\
167 table.stats tr.alt td.smallpink\n\
171 background-color:#FFD7C3;\n\
172 border:1px solid #BB9988;\n\
174 table.stats tr.alt td.red\n\
177 background-color:#FFAABB;\n\
178 border:1px solid #BB6655;\n\
180 table.stats tr.alt td.green\n\
183 background-color:#D6FF93;\n\
184 border:1px solid #A6CC83;\n\
186 table.stats tr.alt td.pink\n\
189 background-color:#FFD7C3;\n\
190 border:1px solid #BB9988;\n\
192 table.stats tr.alt td.azure\n\
195 background-color:#99DDFF;\n\
197 table.stats tr.alt td.gray\n\
200 background-color:#BBBBBB;\n\
201 border:1px solid #999999;\n\
203 table.stats tr.alt td.orange\n\
206 background-color:#FFBB55;\n\
207 border:1px solid #DD9911;\n\
209 table.stats tr.alt td.yellow\n\
212 background-color:#FFFF77;\n\
213 border:1px solid #CCCC33;\n\
215 table.stats td.red\n\
218 background-color:#FF9988;\n\
219 border:1px solid #BB6655;\n\
221 table.stats td.green\n\
224 background-color:#DCFF9A;\n\
225 border:1px solid #AACC89;\n\
227 table.stats td.pink\n\
230 background-color:#FFE5D5;\n\
231 border:1px solid #BB9988;\n\
233 table.stats td.azure\n\
236 background-color:#99DDFF;\n\
238 table.stats tr td.gray\n\
241 background-color:#BBBBBB;\n\
242 border:1px solid #999999;\n\
244 table.stats td.orange\n\
247 background-color:#FFBB66;\n\
248 border:1px solid #DD9911;\n\
250 table.stats td.yellow\n\
253 background-color:#FFFF99;\n\
254 border:1px solid #CCCC33;\n\
260 "font-family:\"Trebuchet MS\", Arial, Helvetica, sans-serif;\n"
264 "border-collapse:collapse;\n"
266 "table.params caption\n"
268 "font-family:\"Trebuchet MS\", Arial, Helvetica, sans-serif;\n"
271 "background-color:#555555;\n"
272 "padding:4px 7px 4px 7px;\n"
274 "table.params tr a\n"
283 "padding-bottom:4px;\n"
284 "background-color:#AAAAAA;\n"
286 "border:1px solid #999999;\n"
288 "table.params td, th\n"
291 "border:1px solid #CBCBCB;\n"
292 "padding:3px 7px 2px 7px;\n"
293 "background-color:#EBEBEB;\n"
295 "table.params tr.alt td\n"
298 "background-color:#DADADA;\n"
303 "font-family:\"Trebuchet MS\", Arial, Helvetica, sans-serif;\n"
307 "border-collapse:collapse;\n"
313 "table.stats td, th\n"
316 "border:1px solid #98bf21;\n"
317 "padding:3px 7px 2px 7px;\n"
319 "table.stats td.small\n"
322 "border:1px solid #98bf21;\n"
323 "padding:3px 7px 2px 7px;\n"
325 "table.stats td.smallpink\n"
328 "padding:3px 7px 2px 7px;\n"
330 "background-color:#FFCCBB;\n"
331 "border:1px solid #BB9988;\n"
338 "padding-bottom:4px;\n"
339 "background-color:#A7C942;\n"
342 "table.stats caption\n"
344 "font-family:\"Trebuchet MS\", Arial, Helvetica, sans-serif;\n"
347 "background-color:#6688FF;\n"
348 "padding:4px 7px 4px 7px;\n"
350 "table.stats tr.alt td\n"
353 "background-color:#EAF2D3;\n"
355 "table.stats tr.alt td.small\n"
359 "background-color:#EAF2D3;\n"
361 "table.stats tr.alt td.smallpink\n"
365 "background-color:#FFBBAA;\n"
366 "border:1px solid #BB9988;\n"
368 "table.stats tr.alt td.red\n"
371 "background-color:#FFAA99;\n"
372 "border:1px solid #BB6655;\n"
374 "table.stats tr.alt td.pink\n"
377 "background-color:#FFBBAA;\n"
378 "border:1px solid #BB9988;\n"
380 "table.stats tr.alt td.azure\n"
383 "background-color:#99DDFF;\n"
385 "table.stats tr.alt td.gray\n"
388 "background-color:#BBBBBB;\n"
389 "border:1px solid #999999;\n"
391 "table.stats tr.alt td.orange\n"
394 "background-color:#FFBB33;\n"
396 "table.stats tr.alt td.yellow\n"
399 "background-color:#FFFF44;\n"
401 "table.stats td.red\n"
404 "background-color:#FF9988;\n"
405 "border:1px solid #BB6655;\n"
407 "table.stats td.pink\n"
410 "background-color:#FFCCBB;\n"
411 "border:1px solid #BB9988;\n"
413 "table.stats td.azure\n"
416 "background-color:#99DDFF;\n"
418 "table.stats tr td.gray\n"
421 "background-color:#BBBBBB;\n"
422 "border:1px solid #999999;\n"
424 "table.stats td.orange\n"
427 "background-color:#FFBB33;\n"
429 "table.stats td.yellow\n"
432 "background-color:#FFFF44;\n"
439 fprintf( output,
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n" );
440 fprintf( output,
"<html lang=\"en\">\n" );
444 fprintf( output,
"</html>\n" );
446 void header(FILE* output,
const char* title,
const char* css,
const char* meta)
448 fprintf( output,
"<head>\n" );
449 fprintf( output,
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n" );
451 fprintf( output, meta );
452 fprintf( output,
"<title>%s</title>\n", title );
453 const char* css_end = css + strlen( css )-4;
454 if (strcmp( css_end,
".css" ) == 0)
455 fprintf( output,
"<link rel=\"stylesheet\" href=\"%s\" type=\"text/css\">\n", css );
457 fprintf( output,
"<style>\n%s\n</style>\n", css );
458 fprintf( output,
"</head>\n ");
462 fprintf( output,
"<body>\n" );
466 fprintf( output,
"</body>\n" );
468 void table_begin(FILE* output,
const char*
id,
const char* cls,
const char* caption)
470 fprintf( output,
"<table id = \"%s\" class = \"%s\">\n",
id, cls );
471 fprintf( output,
"<caption>%s</caption>\n", caption );
475 fprintf( output,
"</table>\n" );
480 va_start( args, output );
482 fprintf( output,
"<tr" );
485 const char* key = va_arg( args,
const char* );
489 const char* value = va_arg( args,
const char* );
491 fprintf( output,
" %s = \"%s\"", key, value );
493 fprintf( output,
">\n" );
499 fprintf( output,
"</tr>\n" );
501 void th(FILE* output,
const char* name, ...)
504 va_start( args, name );
506 fprintf( output,
"<th" );
509 const char* key = va_arg( args,
const char* );
513 const char* value = va_arg( args,
const char* );
515 fprintf( output,
" %s = \"%s\"", key, value );
517 fprintf( output,
">" );
518 fprintf( output,
"%s</th>\n", name );
522 void td(FILE* output,
const char* name, ...)
525 va_start( args, name );
527 fprintf( output,
"<td" );
530 const char* key = va_arg( args,
const char* );
534 const char* value = va_arg( args,
const char* );
536 fprintf( output,
" %s = \"%s\"", key, value );
538 fprintf( output,
">" );
539 fprintf( output,
"%s</td>\n", name );
545 fprintf( output,
"<tr" );
548 const char* key = va_arg( args,
const char* );
552 const char* value = va_arg( args,
const char* );
554 fprintf( output,
" %s = \"%s\"", key, value );
556 fprintf( output,
">\n" );
558 void vth(FILE* output,
const char* name, va_list args)
560 fprintf( output,
"<th" );
563 const char* key = va_arg( args,
const char* );
567 const char* value = va_arg( args,
const char* );
569 fprintf( output,
" %s = \"%s\"", key, value );
571 fprintf( output,
">" );
572 fprintf( output,
"%s</th>\n", name );
574 void vtd(FILE* output,
const char* name, va_list args)
576 fprintf( output,
"<td" );
579 const char* key = va_arg( args,
const char* );
583 const char* value = va_arg( args,
const char* );
585 fprintf( output,
" %s = \"%s\"", key, value );
587 fprintf( output,
">" );
588 fprintf( output,
"%s</td>\n", name );
592 fprintf( output,
"<th" );
595 const char* key = va_arg( args,
const char* );
599 const char* value = va_arg( args,
const char* );
601 fprintf( output,
" %s = \"%s\"", key, value );
603 fprintf( output,
">" );
604 const char* format = va_arg( args,
const char* );
605 vfprintf( output, format, args );
606 fprintf( output,
"</th>\n" );
610 fprintf( output,
"<td" );
613 const char* key = va_arg( args,
const char* );
617 const char* value = va_arg( args,
const char* );
619 fprintf( output,
" %s = \"%s\"", key, value );
621 fprintf( output,
">" );
622 const char* format = va_arg( args,
const char* );
623 vfprintf( output, format, args );
624 fprintf( output,
"</td>\n" );
631 va_start(args, output);
639 va_start(args, name);
640 vth( output, name, args );
647 va_start(args, formatted);
648 vth( output, formatted, args );
699 va_start(args, name);
700 vtd( output, name, args );
707 va_start(args, formatted);
708 vtd( output, formatted, args );
757 FILE* output = fopen(
"test.html",
"w" );
767 table_object table( output,
"my_stats",
"stats",
"stats" );
780 tr_object tr( output,
"class",
"alt", NULL );
791 tr_object tr( output,
"class",
"alt", NULL );
802 tr_object tr( output,
"class",
"alt", NULL );