Hi All, Is anyone know how to make the Perl table have a sort filter like a Microsoft Excel? Maybe need to install any extra library? Below is my perl script show out the standard table in the broswer:
open(INFO, "data.txt"); # Open db for reading @array=<INFO>; close (INFO); @ascend=sort(@array); print $status_table->header('text/html'); # create the HTTP header print $status_table->start_html('Status Table'); # start the HTML print $status_table->h1({-border=>'0', -align=>'center'},'Welcome to +Engineering Equipment List'); print $status_table->start_table({-border=>'5',-align=>'center'}); print $status_table->start_Tr({-align=>'center', -style=>'background-c +olor: #00BFFF'}); print $status_table->start_td; print 'No'; print $status_table->start_td; print 'Equipment ID'; print $status_table->start_td; print 'Description'; print $status_table->start_td; print 'Serial Number'; print $status_table->start_td; print 'Asset Tag'; print $status_table->start_td; print 'MIDA'; print $status_table->start_td; print 'Old MIDA Ref'; print $status_table->start_td; print 'Group'; print $status_table->start_td; print 'Owner'; print $status_table->start_td; print 'Location'; print $status_table->start_td; print 'Location Comment'; print $status_table->start_td; print 'Comment'; print $status_table->start_td; print 'Cost Center'; print $status_table->start_td; print 'Tagging Date'; print $status_table->end_td; print $status_table->end_Tr; foreach my $line (@ascend) { my($Equipment_ID,$Description,$Serial_Number,$Asset_Tag,$MIDA,$Old +_MIDA_Ref,$Group,$Owner,$Location,$Location_Comment,$Comment,$Cost_Ce +nter,$Tagging_Date)=split(/\|/,$line); print $status_table->start_form(-name=>'Detail', -target=>'_top', +-method=>'post', -action=>'detail.pl'); print $status_table->start_Tr; print $status_table->start_td({-align=>'center'}); print $i++; print $status_table->start_td({-align=>'center'}); print "$Equipment_ID"; print $status_table->start_td; print "$Description"; print $status_table->start_td({-align=>'center'}); print "$Serial_Number"; print $status_table->start_td({-align=>'center'}); print "$Asset_Tag"; print $status_table->start_td({-align=>'center'}); print "$MIDA"; print $status_table->start_td({-align=>'center'}); print "$Old_MIDA_Ref"; print $status_table->start_td({-align=>'center'}); print "$Group"; print $status_table->start_td({-align=>'center'}); print "$Owner"; print $status_table->start_td; print "$Location"; print $status_table->start_td; print "$Location_Comment"; print $status_table->start_td; print "$Comment"; print $status_table->start_td({-align=>'center'}); print "$Cost_Center"; print $status_table->start_td({-align=>'center'}); print "$Tagging_Date"; print $status_table->end_td; print $status_table->end_Tr; print $status_table->end_form; } print $status_table->end_table; #end the table print $status_table->end_html; # end the HTML
Thanks

In reply to Need help to guide how to create client sort table by GordonLim

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.