def list_to_html_table(table, style=None):
    """Turns a list into a html table

    Args:
        table (list):
        style (str, optional): The html style of the table. Defaults to None.

    Returns:
        str: Html code for the table
    """
    htmlstr = ""
    rowstr = ""
    if style is None:
        htmlstr = "<style>table, th, td {border:1px solid black;}</style>"
    for cell in table[0]:
        cell = str(cell)
        rowstr += "<th>{}</th>".format(cell)
    htmlstr += "<tr>{}</tr>".format(rowstr)
    for row in table[1:]:
        rowstr = ""
        for cell in row:
            cell = str(cell)
            rowstr += "<td>{}</td>".format(cell)
        htmlstr += "<tr>{}</tr>".format(rowstr)
    htmlstr = "<table style = 'width:100%'>{}</table>".format(htmlstr)
    return htmlstr