Based on the code you've posted, it's not clear to me (because I lack CSS experience) how the div and br tags are being transformed into a table layout. In any case, if I were to try to do this without HTML::Template, it would probably look something like this (note that I'm not using div or br tags, either, but maybe you can work that out yourself, if it matters):
(not tested)# create a reference to a hash with @$times as keys and values: my $times_href = { map { $_ => $_ } @$times }; # add the image tagging to the $icon elements: $icons->{$_} = "<img src=\"$icons->{$_}\" alt=\"\" />" for ( keys %$ic +ons ); print "<table>\n"; for my $dref ( $icons, $times_href, $conditions, $hilo, $temperatures +) { print "<tr>"; print "<td>$dref->{$_}</td>" for ( @$times ); print "</tr>\n"; } print "</table>\n";
Since most of your data is in hash refs already, putting the @$times data into a hash ref as well means that you can treat all the table rows the same way, and you still use @$times to run the loop that prints the columns on each row in the proper order.
(updated to add (and fix) the for loop that modifies the contents of the $icons hash ref, so that they can also be used the same way as the other hash refs when printing the table)
(another update: I realize that I've left out some of the details in the OP code, like adding the "°F" on the temperatures, the "abbr" tags, etc. But these would be handled the same way as adding the "img" tagging on the "%$icons" data.)
In reply to Re: For statement 2 html table
by graff
in thread For statement 2 html table
by senik148
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |