Mercurial > repos > saskia-hiltemann > ireport
comparison tsv2html_simple.pl @ 0:ac5f9272033b draft
first upload
author | saskia-hiltemann |
---|---|
date | Tue, 01 Jul 2014 11:42:23 -0400 |
parents | |
children | 42076db43d42 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:ac5f9272033b |
---|---|
1 print <<END; | |
2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
3 "http://www.w3.org/TR/html4/strict.dtd"> | |
4 <html> | |
5 <head> | |
6 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> | |
7 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js"></script> | |
8 <script type="text/javascript" src="jquery.dataTables.js"></script> | |
9 <script type="text/javascript" src="iframe-resizer/js/iframeResizer.contentWindow.min.js"></script> | |
10 <script> | |
11 | |
12 <!-- data tables --> | |
13 \$(document).ready(function() { | |
14 \$('#datatable').dataTable( { | |
15 "bPaginate": false, | |
16 "bLengthChange": false, | |
17 "bFilter": false, | |
18 "bSort": false, | |
19 "bInfo": false, | |
20 "bAutoWidth": true | |
21 } ); | |
22 } ); | |
23 <!-- data tables --> | |
24 </script> | |
25 | |
26 <link rel="stylesheet" type="text/css" href="jquery.dataTables.css"> | |
27 </head> | |
28 <body> | |
29 <table class="display dataTable" id="datatable" border="1" cellspacing="0" cellpadding="0" style="font-size: 12px;" > | |
30 <thead> | |
31 <tr><th> | |
32 END | |
33 chomp ($_ = <STDIN>); | |
34 s?\t?</th><th>?g; | |
35 print "$_</th></tr>\n"; | |
36 #print "</tr>\n</thead>\n<tbody>\n"; | |
37 print "</thead>\n<tbody>\n"; | |
38 while (<>) { | |
39 print "<tr>\n"; | |
40 my @fields = split('\t'); | |
41 my $first=1; | |
42 for $cell(@fields) { | |
43 if($cell =~ /^(\d|\s)+$/) { | |
44 1 while ($cell =~ s/^(-?\d+)(\d{3})/$1,$2/); | |
45 print "<td align=\"right\">$cell</td>"; | |
46 #print "<td>$cell</td>"; | |
47 } | |
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 |