'Internally used method to assign a style to the table
@param startRow: The row from the data that the first data row in
the table refers to. When a table is split the first row in the
table (ignoring the label header row) will not always be the first row
in the data. This is needed to align the two. Currently this parameter
is used to identify sub headings and give them an emphasised styling
@param rowCnt: The number of rows in the table
@param endCol: The last column in the table
@todo: replace endCol with -1
(should work but need to test with a split table)'

def tableStyle(self, startRow, rowCnt, endCol, colour_required=False):

    font_name_bold = self.font_name_bold
    style = [('FONTNAME', (0, 0), ((-1), (-1)), self.font_name), ('FONTSIZE', (0, 0), ((-1), (-1)), self.fontsize), ('VALIGN', (0, 0), ((-1), (-1)), 'TOP'), ('LINEBELOW', (0, 0), (endCol, 0), 1, Color(0, 0, 0)), ('FONTNAME', (0, 0), (endCol, 0), font_name_bold)]
    sappend = style.append
    if colour_required:
        sappend(('BACKGROUND', (0, 0), (endCol, 0), self.headerColour))
    else:
        sappend(('BACKGROUND', (0, 0), ((-1), 0), colors.lightgrey))
        sappend(('INNERGRID', (0, 0), ((-1), (-1)), 0.2, colors.lightgrey))
    if (self.pdf_groupby != None):
        sappend(('LEFTPADDING', (0, 0), ((-1), (-1)), 20))
    rowColourCnt = 0
    for i in range(rowCnt):
        if ((startRow + i) in self.subheadingList):
            level = self.subheadingLevel[(startRow + i)]
            if colour_required:
                sappend(('BACKGROUND', (0, i), (endCol, i), self.headerColour))
            sappend(('FONTNAME', (0, i), (endCol, i), font_name_bold))
            sappend(('SPAN', (0, i), (endCol, i)))
            sappend(('LEFTPADDING', (0, i), (endCol, i), (6 * level)))
        elif (i > 0):
            if colour_required:
                if ((rowColourCnt % 2) == 0):
                    sappend(('BACKGROUND', (0, i), (endCol, i), self.evenColour))
                    rowColourCnt += 1
                else:
                    sappend(('BACKGROUND', (0, i), (endCol, i), self.oddColour))
                    rowColourCnt += 1
    sappend(('BOX', (0, 0), ((-1), (-1)), 1, Color(0, 0, 0)))
    return style
