tobyink, headings are rows just like data and whead so modifying your example of usage ...
table(1, { id => 't1', rows => [ headings => [qw/NAME STRENGTH COMMENT/], whead => [ # multiple rows with the first cell being a header. [1, [2, { style => 'text-align: right' }], 'no'], [2, [3, { style => 'text-align: right' }], 'yes'], [10, [20, { style => 'text-align: right' }], 'another'], [100, [200, { style => 'text-align: right' }], 'comment'], ], headings => [['List to go with the whead' { colspan => 3 }]], data => [['list', { class => 'info', colspan => 3, list => [$ +list, { class => 'two_cols' }] }]], ], });
I can understand why you would want to pass individual rows, however, you are not taking into consideration a table with hundreds or even thousands of rows. I have one table with over 2,000 rows, so I would prefer a way to pass them through with an arrayref. In my modified example, I put headings inside of rows. I can not have two headings currently and can not set the order in which the row groups are displayed.
Oh, line comes from another module, so if possible, is there a way to use it as is? I use line in every script I write where I am printing lines.
choroba suggested I build the @attributes separately, and I agree. I will be looking at what he did and see how I can modify it to my exact needs then adding it to the module.
Also, the last time I tried figuring out OO, I was told I did it all wrong. OO and I have not become friends yet. So, right now I do not know what to ask on how to change what you wrote to suit my desires. Give me a lot of time to understand what you wrote, please?
Update: It looks like you dropped the attributes from all the elements except table. Every HTML tag can have its own attributes. Since I am generating the HTML with perl, I could go really crazy and give every element its own id, but I will refrain.
In reply to Re^2: I'm stuck adding more named parameters to a subroutine since the new named parameters might have the same name as the current ones.
by Lady_Aleena
in thread I'm stuck adding more named parameters to a subroutine since the new named parameters might have the same name as the current ones.
by Lady_Aleena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |