Search code examples
python-3.6reportlab

Is there a way to keep first row always the same when we are creating a table with reportlab?


I am creating a table with reportlab library at python3. I want to keep the first row between pages as a header, is there a easy way to do it? I am using the open source version from the library and I am usually using subclass to override function then using them. I don't know if it is working on the same way. Does anyone had a similar problem?

Thanks in advance.

Regards.


Solution

  • That may help you:

    myTable = Table(data, repeatRows=1)
    
    # From documentation:
    
    Table(data, colWidths=None, rowHeights=None, style=None, splitByRow=1,repeatRows=0, repeatCols=0, rowSplitRange=None, spaceBefore=None,spaceAfter=None)