project_report/project_report_latex.py
def create_vertical_table(container, header, rows, column_def=None, footer=None):
        """
        Create a table with the specified header at the top in the provided container.
        The table is created using the tabu package. http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/tabu/tabu.pdf
        The header will be formatted as bold.
        :param container: The container where the table will be added.
        :param header: A list containing the column header.
        :param rows: A list of list containing each cell's content.
        :param column_def: a list of string describing each column.
        :param footer: An optional list of footer lines.
        """
        def add_footer_rows(foot):
            if not isinstance(foot, list):
                foot = [foot]
            for f in foot:
                data_table.add_row((MultiColumn(ncol - 1, align='l', data=f), ''))

        ncol = len(header)
        if not column_def:
            column_def = ' '.join(['X[r]'] * ncol)
        # Using the tabu package -> http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/tabu/tabu.pdf
        with container.create(LongTabu(column_def, width=ncol)) as data_table:
            data_table.add_hline()
            data_table.add_row(header, mapper=bold)
            data_table.add_hline()
            data_table.end_table_header()
            # Footer contains the next page notice
            data_table.add_hline()
            if footer:
                add_footer_rows(footer)
            data_table.add_row((MultiColumn(ncol, align='r', data='Continued on Next Page'),))
            data_table.add_hline()
            data_table.end_table_footer()
            # Last footer does not have the next page row
            if footer:
                add_footer_rows(footer)
            data_table.end_table_last_footer()
            for r in rows:
                data_table.add_row(r)
            data_table.add_hline()

        Create a table with the specified header at the top in the provided container.
        The table is created using the tabu package. http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/tabu/tabu.pdf
        The header will be formatted as bold.
        :param container: The container where the table will be added.
        :param header: A list containing the column header.
        :param rows: A list of list containing each cell's content.
        :param column_def: a list of string describing each column.
        :param footer: An optional list of footer lines.
        
Create a table with the specified header at the top in the provided container.
The table is created using the tabu package.
Create a table with the specified header at the top in the provided container . The table is created using the tabu package .
def create_vertical_table(container, header, rows, column_def=None, footer=None):
        def add_footer_rows(foot):
            if not isinstance(foot, list):
                foot = [foot]
            for f in foot:
                data_table.add_row((MultiColumn(ncol - 1, align='l', data=f), ''))
        ncol = len(header)
        if not column_def:
            column_def = ' '.join(['X[r]'] * ncol)
        with container.create(LongTabu(column_def, width=ncol)) as data_table:
            data_table.add_hline()
            data_table.add_row(header, mapper=bold)
            data_table.add_hline()
            data_table.end_table_header()
            data_table.add_hline()
            if footer:
                add_footer_rows(footer)
            data_table.add_row((MultiColumn(ncol, align='r', data='Continued on Next Page'),))
            data_table.add_hline()
            data_table.end_table_footer()
            if footer:
                add_footer_rows(footer)
            data_table.end_table_last_footer()
            for r in rows:
                data_table.add_row(r)
            data_table.add_hline()
def create_vertical_table ( container , header , rows , column_def = None , footer = None ) : def add_footer_rows ( foot ) : if not isinstance ( foot , list ) : foot = [ foot ] for f in foot : data_table . add_row ( ( MultiColumn ( ncol - 1 , align = 'l' , data = f ) , '' ) ) ncol = len ( header ) if not column_def : column_def = ' ' . join ( [ 'X[r]' ] * ncol ) with container . create ( LongTabu ( column_def , width = ncol ) ) as data_table : data_table . add_hline ( ) data_table . add_row ( header , mapper = bold ) data_table . add_hline ( ) data_table . end_table_header ( ) data_table . add_hline ( ) if footer : add_footer_rows ( footer ) data_table . add_row ( ( MultiColumn ( ncol , align = 'r' , data = 'Continued on Next Page' ) , ) ) data_table . add_hline ( ) data_table . end_table_footer ( ) if footer : add_footer_rows ( footer ) data_table . end_table_last_footer ( ) for r in rows : data_table . add_row ( r ) data_table . add_hline ( )
Create a table with the specified header at the top in the provided container.
Create a table with the specified header at the top in the provided container .
"""
        Create a table with the specified header at the top in the provided container.
        The table is created using the tabu package. http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/tabu/tabu.pdf
        The header will be formatted as bold.
        :param container: The container where the table will be added.
        :param header: A list containing the column header.
        :param rows: A list of list containing each cell's content.
        :param column_def: a list of string describing each column.
        :param footer: An optional list of footer lines.
        """ # Using the tabu package -> http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/tabu/tabu.pdf # Footer contains the next page notice # Last footer does not have the next page row
container
The container where the table will be added.
The container where the table will be added .
header
A list containing the column header.
A list containing the column header .
rows
A list of list containing each cell's content.
A list of list containing each cell ' s content .
column_def
a list of string describing each column.
a list of string describing each column .
footer
An optional list of footer lines.
An optional list of footer lines .