@@ -207,6 +207,7 @@ func (t *Table) renderLine(out *strings.Builder, row rowStr, hint renderHint) {
207207 if outLine != out {
208208 t .renderLineMergeOutputs (out , outLine )
209209 }
210+ t .firstRowOfPage = false
210211
211212 // if a page size has been set, and said number of lines has already
212213 // been rendered, and the header is not being rendered right now, render
@@ -219,6 +220,7 @@ func (t *Table) renderLine(out *strings.Builder, row rowStr, hint renderHint) {
219220 out .WriteString (t .style .Box .PageSeparator )
220221 t .renderRowsBorderTop (out )
221222 t .renderRowsHeader (out )
223+ t .firstRowOfPage = true
222224 }
223225 }
224226}
@@ -313,36 +315,13 @@ func (t *Table) renderRows(out *strings.Builder, rows []rowStr, hint renderHint)
313315 hint .rowNumber = rowIdx + 1
314316 t .renderRow (out , row , hint )
315317
316- if t .shouldSeparate (rowIdx , len (rows )) {
318+ if t .shouldSeparateRows (rowIdx , len (rows )) {
317319 hint .isFirstRow = false
318320 t .renderRowSeparator (out , hint )
319321 }
320322 }
321323}
322324
323- func (t * Table ) shouldSeparate (rowIdx int , numRows int ) bool {
324- // last row before footer
325- if t .style .Options .SeparateRows && rowIdx < numRows - 1 {
326- return true
327- }
328- // no manually added separator
329- if ! t .separators [rowIdx ] {
330- return false
331- }
332-
333- pageSize := numRows
334- if t .pageSize > 0 {
335- pageSize = t .pageSize
336- }
337- if rowIdx % pageSize == pageSize - 1 { // last row of page
338- return false
339- }
340- if rowIdx == numRows - 1 { // last row of table
341- return false
342- }
343- return true
344- }
345-
346325func (t * Table ) renderRowsBorderBottom (out * strings.Builder ) {
347326 if len (t .rowsFooter ) > 0 {
348327 t .renderRowSeparator (out , renderHint {
0 commit comments