choroba, I am very close to having what I want now. I just have to figure out how to get some conditionals nestled in the code somewhere. The new table subroutine is...

sub table { my ($tab,$opt) = @_; my $attributes = get_attributes($opt,['id','class','style']); my $open = 'table'.$attributes; line($tab,qq(<$open>)); line($tab + 1,qq(<caption>$opt->{caption}</caption>)) if $opt->{capt +ion}; cols($tab + 1, $_) if $opt->{cols}; for my $rowgroup (@{$opt->{rows}) { my $type = $rowgroup->[0]; my @rows = @{$rowgroup->[1]; my $attributes = $rowgroup->[2]; for my $row (@rows) { if ($type eq 'header') { row($tab + 1, $type , $row); } else { row($tab + 1, $type , $_) for @$row; } } } line($tab,q(</table>)); }

I used an array as you suggested, but used arrays in the array instead. Here are several tables using it now.

# From ArmorClass.pm my $table_id = idify($table_name); table($tab,{ id => $table_id, class => 'player_character armor_class +', caption => $table_name, rows => [ ['header',['&nbsp;',map(ucfirst $_,qw(unarmored armored))]], ['whead',\@rows], ['header',[['Armor', { colspan => 3 }]]], # This & next have a c +ondition. ['data',[[['list', { class => "info", colspan => 3, list => ['u' +,$armor] }]]]] ] }); # From Psionics.pm my $table_id = idify($table_name); table($tab, { id => "$table_id", class => 'player_character psionic +s', caption => $table_name, rows => [ ['header',['&nbsp;','Amount']], ['whead',\@rows] ] }); # From RogueSkills.pm my $table_id = idify($table_name); table($tab, { id => "$table_id", class => 'player_character rogue_sk +ills', caption => $table_name, rows => [ ['header',['Skill','%']], ['whead',\@rows], ['header',[['Other', { colspan => 2 }]]], ['data',[[['list', { class => "info", list => ['u',$other_skills +] }]]]] ] }); # From SavingThrows.pm my $table_id = idify($table_name); table($tab, { id => "$table_id", class => 'player_character saving_ +throws', caption => $table_name, rows => [ ['header',['Save','Throw']], ['whead',\@rows], ['header',[['Modifiers', { colspan => 2}]]], # This & next have +a condition. ['data',[[['list', { class => "info", colspan => 2, list => ['u' +,$modifiers] }]]]] ] }); #From SpellProgression.pm my $table_id = idify($table_name); table($tab, { id => "$table_id", class => 'player_character spell +_progression', caption => $table_name, rows => [ ['header',\@headings], ['whead',\@rows], ['header',[['Spellbook', { colspan => $colspan }]]], # This & +next have a condition. ['data',[[[qq(<a href="../../../Role_playing/Spellbooks/$filen +ame.pl">$name\'s Spellbook</a>), { colspan => $colspan }]]]] ] }); # From THAC0.pm my $table_id = idify($table_name); table($tab, { id => "$table_id", class => 'player_character THAC0', rows => [ ['header',\@headings], ['whead',\@rows], ['header',[['Weapons', { colspan => $colspan }]]], # This & next + have a condition. ['data',[[['list', { class => 'info', colspan => $colspan, list +=> ['u',$weapons, { class => 'two' }] }]]]] ] });

They may not be pretty, but they work almost as I want them to. Thank you for your array suggestion.

Have a cookie and a very nice day!
Lady Aleena

In reply to Re^4: 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

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.