comparison tsv2html.pl @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
children 440f4aa3db97
comparison
equal deleted inserted replaced
-1:000000000000 0:ac5f9272033b
1 print <<END;
2 <!DOCTYPE HTML>
3 <html>
4 <head>
5 <script src=\"//code.jquery.com/jquery-1.10.2.js\"></script>
6 <script src=\"//code.jquery.com/ui/1.10.4/jquery-ui.js\"></script>
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 } );
22 <!-- data tables -->
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