Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

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

More than once in the past, I have found myself having to dynamically generate (near) real-time summaries of random data in HTML table form. Up until now, I've been hand-rolling my own solutions. But I've found myself re-using a lot of code and I'm wondering if there may already be a module that does most of what I need. I'll admit up-front that I've only had a cursory look through CPAN. Modules such as HTML::Table, HTML::Table::Compiler and HTML::QuickTable caught my eye, but I'm not sure that any of them are quite right.

Generally, I will be working with two (or more) distinct (but related) datasets. One will be a bunch of metadata - for example a list of hosts and associated properties (ip address, location name, country, etc). This data would normally come from a database.

The second set will be real-time data collected from these hosts. This data would typically be a result of parsing a number of logfiles.

A good example of this was MRTG data collected from several hosts. In this case, I needed to present a summary table listing all hosts and associated data, and then allow several user-defined actions - such as sorting/filtering and displaying/not displaying optional fields.

As I said, I already have my own hand-rolled solution for this, but every time I "re-use" it I inwardly cringe a little and can't help feeling that I keep re-inventing the wheel.

I guess what I am looking for is a general framework whereby I can arbitrarily define:

  • one or more datasets
  • several fields and associated properties, eg. source, datatype (for sorting), display order, field alignment, hyperlink URL, etc, etc..
  • other "general" properties, such as shading colour for alternate rows

So my question is: Is there a module available that would provide a good generic framework to meet the needs I've outlined above?

(If there isn't, perhaps I'll take what I've already done and have a go at turning it into a module, because (at least for me) I believe it could be quite useful)

Thanks,
Darren :)


In reply to Creating dynamic HTML tables based on user-actions by McDarren

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 examining the Monastery: (5)
As of 2024-04-19 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found