+ if (!$self->{custom_headers}) {
+ $data_row = [];
+ $cell_props_row = [];
+ push @data, $data_row;
+ push @cell_props, $cell_props_row;
+
+ foreach my $name (@visible_columns) {
+ my $column = $self->{columns}->{$name};
+
+ push @{ $data_row }, $column->{text};
+ push @{ $cell_props_row }, {};
+ }
+
+ } else {
+ $num_header_rows = scalar @{ $self->{custom_headers} };
+
+ foreach my $custom_header_row (@{ $self->{custom_headers} }) {
+ $data_row = [];
+ $cell_props_row = [];
+ push @data, $data_row;
+ push @cell_props, $cell_props_row;
+
+ foreach my $custom_header_col (@{ $custom_header_row }) {
+ push @{ $data_row }, $custom_header_col->{text};
+
+ my $num_output = ($custom_header_col->{colspan} * 1 > 1) ? $custom_header_col->{colspan} : 1;
+ if ($num_output > 1) {
+ push @{ $data_row }, ('') x ($num_output - 1);
+ push @{ $cell_props_row }, { 'colspan' => $num_output };
+ push @{ $cell_props_row }, ({ }) x ($num_output - 1);