+ my $tabledata = [];
+
+ foreach my $entry (@$data) {
+
+ my $height = 1;
+ my $rowdata = {};
+
+ for (my $i = 0; $i < $column_count; $i++) {
+ my $prop = $props_to_print->[$i];
+ my $propinfo = $returnprops->{$prop} // {};
+
+ my $text = data_to_text($entry->{$prop}, $propinfo);
+ my $lines = [ split(/\n/, $text) ];
+ my $linecount = scalar(@$lines);
+ $height = $linecount if $linecount > $height;
+
+ my $width = 0;
+ foreach my $line (@$lines) {
+ my $len = length($line);
+ $width = $len if $len > $width;
+ }
+
+ $rowdata->{$prop} = {
+ lines => $lines,
+ width => $width,
+ };
+ }
+
+ push @$tabledata, {
+ height => $height,
+ rowdata => $rowdata,
+ };
+ }
+