<html>, <body>, "\n",
($data->{wrapper}||sub{@_})->(
'', <table>, "\n",
- (map { my $el = $_;
- ' ', ($el->{key} eq '__error__') ? <tr class="error"> : <tr>,
- (map {
- <td>, $self->render_el($el, $_, $el->{$_}), </td>
- } @{$data->{columns}}),
- </tr>, "\n"
- } @rows),
+ @rows
+ ? (map { my $el = $_;
+ ' ', ($el->{key} eq '__error__') ? <tr class="error"> : <tr>,
+ (map {
+ <td>, $self->render_el($el, $_, $el->{$_}), </td>
+ } @{$data->{columns}}),
+ </tr>, "\n"
+ } @rows)
+ : (<tr class="no-rows">,
+ <td>, 'No entries in this data structure', </td>,
+ </tr>),
'', </table>, "\n",
),
</body>, </html>, "\n",