@@ -655,6 +655,8 @@ function _text__print_table(
655655        end 
656656
657657        action, rs, ps =  _next (ps, table_data)
658+         _, next_rs, _  =  _next (ps, table_data)
659+ 
658660        ir, jr =  _update_data_cell_indices (action, rs, ps, ir, jr)
659661
660662        action ==  :end_printing  &&  break 
@@ -887,7 +889,7 @@ function _text__print_table(
887889
888890            #  == Handle the Horizontal Lines ===============================================
889891
890-             if  (rs ==  :column_labels ) &&  (ps . row_section  ==  :column_labels )
892+             if  (rs ==  :column_labels ) &&  (next_rs  ==  :column_labels )
891893                if  (ps. i ∈  horizontal_lines_at_column_labels)
892894                    _text__print_column_label_horizontal_line (
893895                        display,
@@ -921,7 +923,7 @@ function _text__print_table(
921923                end 
922924
923925            #  Print the horizontal line after the column labels.
924-             elseif  (rs ==  :column_labels ) &&  (ps . row_section  !=  :column_labels ) && 
926+             elseif  (rs ==  :column_labels ) &&  (next_rs  !=  :column_labels ) && 
925927                tf. horizontal_line_after_column_labels
926928
927929                #  We should skip this line if we have a row group label at the first column.
@@ -999,7 +1001,7 @@ function _text__print_table(
9991001                _text__flush_line (display, false )
10001002                num_printed_data_section_lines +=  1 
10011003
1002-             elseif  (rs ∈  (:data , :continuation_row )) &&  (ps . row_section  ==  :summary_row ) && 
1004+             elseif  (rs ∈  (:data , :continuation_row )) &&  (next_rs  ==  :summary_row ) && 
10031005                tf. horizontal_line_before_summary_rows
10041006
10051007                    _text__print_column_label_horizontal_line (
@@ -1092,7 +1094,7 @@ function _text__print_table(
10921094            #  == Omitted Cell Summary ======================================================
10931095
10941096            #  We also must show the omitted cell summary if the user requested it.
1095-             if  (ps . row_section  ==  :table_footer ) &&  pspec. show_omitted_cell_summary
1097+             if  (next_rs  ==  :table_footer ) &&  pspec. show_omitted_cell_summary
10961098                ocs =  _omitted_cell_summary (
10971099                    num_omitted_data_rows,
10981100                    num_omitted_data_columns
0 commit comments