From: Robert 'phaylon' Sedlacek Date: Wed, 20 Jun 2012 22:39:01 +0000 (+0000) Subject: have no rows marker work as expected with columns X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d568eb4c2034f13d0e336e61c397f3312788751b;p=scpubgit%2FJSON-Tree-Viewer.git have no rows marker work as expected with columns --- diff --git a/br.pl b/br.pl index efdc3af..08fe3b6 100644 --- a/br.pl +++ b/br.pl @@ -219,21 +219,25 @@ sub render_table { $data->{show_columns} ? { map +($_ => $_), @{$data->{columns}} } : (), @{$data->{data}} ); + my $column_count = scalar @{$data->{columns}}; [ 200, [ 'Content-type' => 'text/html' ], [ HTML::Tags::to_html_string( , , "\n", ($data->{wrapper}||sub{@_})->( '', , "\n", - @rows - ? (map { my $el = $_; - ' ', ($el->{key} eq '__error__') ? : , - (map { - - } @{$data->{columns}}), - , "\n" - } @rows) + (map { my $el = $_; + ' ', ($el->{key} eq '__error__') ? : , + (map { + + } @{$data->{columns}}), + , "\n" + } @rows), + @{$data->{data}} + ? () : (, - , + , ), '',
, $self->render_el($el, $_, $el->{$_}),
, $self->render_el($el, $_, $el->{$_}),
, 'No entries in this data structure', , + 'No entries in this data structure', +
, "\n", ),