From: Robert 'phaylon' Sedlacek Date: Wed, 20 Jun 2012 19:45:27 +0000 (+0000) Subject: add a marker and a notice if the table did not contain any rows X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FJSON-Tree-Viewer.git;a=commitdiff_plain;h=a3808ee65bc77be5eb2ad4b07941d8c79a0314fe add a marker and a notice if the table did not contain any rows --- diff --git a/br.pl b/br.pl index 590d940..f900028 100644 --- a/br.pl +++ b/br.pl @@ -195,13 +195,17 @@ sub render_table { , , "\n", ($data->{wrapper}||sub{@_})->( '', , "\n", - (map { my $el = $_; - ' ', ($el->{key} eq '__error__') ? : , - (map { - - } @{$data->{columns}}), - , "\n" - } @rows), + @rows + ? (map { my $el = $_; + ' ', ($el->{key} eq '__error__') ? : , + (map { + + } @{$data->{columns}}), + , "\n" + } @rows) + : (, + , + ), '',
, $self->render_el($el, $_, $el->{$_}),
, $self->render_el($el, $_, $el->{$_}),
, 'No entries in this data structure',
, "\n", ), , , "\n",