Mercurial > repos > saskia-hiltemann > ireport
annotate tsv2html.pl @ 9:7300ed4c1481 draft default tip
Uploaded
author | saskia-hiltemann |
---|---|
date | Mon, 04 Sep 2017 10:49:00 -0400 |
parents | 42076db43d42 |
children |
rev | line source |
---|---|
0 | 1 print <<END; |
2 <!DOCTYPE HTML> | |
3 <html> | |
4 <head> | |
1 | 5 <script src=\"jquery-1.10.2.js\"></script> |
6 <script src=\"jquery-ui.js\"></script> | |
0 | 7 <script type="text/javascript" src="jquery.dataTables.js"></script> |
8 <script type="text/javascript" src="iframe-resizer/js/iframeResizer.contentWindow.min.js"></script> | |
9 <script> | |
10 | |
11 <!-- data tables --> | |
12 \$(document).ready(function() { | |
13 \$('#datatable').dataTable( { | |
14 "bPaginate": true, | |
15 "bLengthChange": true, | |
16 "bFilter": true, | |
17 "bSort": true, | |
18 "bInfo": true, | |
19 "bAutoWidth": true | |
20 } ); | |
21 } ); | |
6
42076db43d42
Fixed auto resizing plus various other minor bugs
saskia-hiltemann
parents:
1
diff
changeset
|
22 <!-- data tables tsv2html.pl--> |
0 | 23 </script> |
24 | |
25 <link rel="stylesheet" type="text/css" href="jquery.dataTables.css"> | |
26 </head> | |
27 <body> | |
28 <table class="display dataTable" id="datatable" border="1" cellspacing="0" cellpadding="0" style="font-size: 12px;" > | |
29 <thead> | |
30 <tr><th> | |
31 END | |
32 chomp ($_ = <STDIN>); | |
33 s?\t?</th><th>?g; | |
34 print "$_</th></tr>\n"; | |
35 #print "</tr>\n</thead>\n<tbody>\n"; | |
36 print "</thead>\n<tbody>\n"; | |
37 while (<>) { | |
38 print "<tr>\n"; | |
39 my @fields = split('\t'); | |
40 my $first=1; | |
41 for $cell(@fields) { | |
42 if($first == 1){ | |
43 print "<td> $cell </td>"; | |
44 $first=0; | |
45 } | |
46 elsif($cell =~ /^(\d|\s)+$/) { | |
47 print "<td align=\"right\">$cell</td>"; } | |
48 else { | |
49 print "<td>$cell</td>"; } } | |
50 print "</tr>\n"; } | |
51 #print "</tr>\n</tbody>\n</table></body></html>\n"; | |
52 print "</tbody>\n</table></body></html>\n"; | |
53 |