def create_table_string(content, row_labels, col_labels, format, caption):
    """
    Create a table following a specific formatting based on provided
    rows, columns and table entries.

    Args:
        content: Numpy `ndarray` of shape `(rows, columns)` containing the
            contents of the table.
        row_labels: List containing the labels that should be at the start of
            each row.
        col_labels: List containing the labels that should be at the top most
            row of the table.
        format: String indicating the formatting of the table. Currently
            supported are `csv` and `tex`.
        caption: Caption that should be used for the table. Currently this 
            option will only be used when creating a `tex` table.
    
    Returns:
        A string containing the table formatted with the rules of the user
        indicated format.
    
    Raises:
        Exception: Format '?' unknown for table creation. Currently supported
            are 'csv' and 'tex'.
    """
    # Create table following correct format
    output = ''
    if format == 'csv':
        # Create .csv file
        if col_labels is not None:
            line = [''] + col_labels
            output += ','.join(line) + "\n"
        for i, row in enumerate(row_labels):
            line = [row] + list(map(str, content[i]))
            output += ','.join(line) + "\n"
    elif format == 'tex':
        # Create .tex table
        output = '\\begin{table}\n\\centering\n\\begin{tabular}'
        output += "{" + ("l|" + "c" * len(content[0])) + "}\n"
        if col_labels is not None:
            line = [''] + col_labels
            output += ' & '.join(line) + '\\\\' + "\n"
            output += '\\hline \n'
        for i, row in enumerate(row_labels):
            line = [row] + list(map(str, content[i]))
            output += ' & '.join(line) + '\\\\' + "\n"
        output += "\\end{tabular}\n"
        output += "\\caption{" + caption + "}\n"
        output += "\\end{table}"
    else:
        raise Exception(
            "Format '{}' unknown for table creation. Currently supported are 'csv' and 'tex'."
            .format(format))
    return output