Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Since you specifically said client filtering of a table, and since your table is HTML, I believe that what you're really looking for is a way for your Perl code to generate simple HTML based on your data set and having a person's web browser do the work of sorting, filtering, and possibly editing. With that in mind, I highly recommend that you use DataTables or similar. I've used DataTables, and there is much documentation on how to do pretty styling, but more to your point, there is a built in API for column filtering.

Current best practice for web applications is to NOT put inline attributes like fonts and colors, relying on CSS to do all styling. Furthermore, you should consider your Perl code as a data source for your tables, and use AJAX to have a web browser send requests using JavaScript and your Perl code return data, probably in a form like JSON for the JavaScript to interpret and display.

To get started quickly, what I would do is to take your code, get rid of the inline styling, just make a syntactically correct table, have your HTML page include DataTables, and use JavaScript to quickly get your sorting and filtering working.


In reply to Re: How to add the client filtering function in perl table? by Sinistral
in thread How to add the client filtering function in perl 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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-03-29 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found