@@ -207,6 +207,7 @@ func (t *Table) renderLine(out *strings.Builder, row rowStr, hint renderHint) {
207
207
if outLine != out {
208
208
t .renderLineMergeOutputs (out , outLine )
209
209
}
210
+ t .firstRowOfPage = false
210
211
211
212
// if a page size has been set, and said number of lines has already
212
213
// 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) {
219
220
out .WriteString (t .style .Box .PageSeparator )
220
221
t .renderRowsBorderTop (out )
221
222
t .renderRowsHeader (out )
223
+ t .firstRowOfPage = true
222
224
}
223
225
}
224
226
}
@@ -313,36 +315,13 @@ func (t *Table) renderRows(out *strings.Builder, rows []rowStr, hint renderHint)
313
315
hint .rowNumber = rowIdx + 1
314
316
t .renderRow (out , row , hint )
315
317
316
- if t .shouldSeparate (rowIdx , len (rows )) {
318
+ if t .shouldSeparateRows (rowIdx , len (rows )) {
317
319
hint .isFirstRow = false
318
320
t .renderRowSeparator (out , hint )
319
321
}
320
322
}
321
323
}
322
324
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
-
346
325
func (t * Table ) renderRowsBorderBottom (out * strings.Builder ) {
347
326
if len (t .rowsFooter ) > 0 {
348
327
t .renderRowSeparator (out , renderHint {
0 commit comments