diff --git a/src/class-cf7-extras-integration-tablepress.php b/src/class-cf7-extras-integration-tablepress.php index d69b305..22e1eaf 100644 --- a/src/class-cf7-extras-integration-tablepress.php +++ b/src/class-cf7-extras-integration-tablepress.php @@ -151,6 +151,17 @@ private function get_data_for_table( $table, $form_data ) { $table['data'][] = $table_row; // Append our row. + $max_cols = max( array_map( 'count', $table['data'] ) ); + $cols_fill = array_fill( 0, $max_cols, '' ); + + // Ensure all rows have the same number of columns. + $table['data'] = array_map( + function( $row ) use ( $cols_fill ) { + return array_replace( $cols_fill, $row ); + }, + $table['data'] + ); + return $table; }