def np_matrix_as_table(np_array, headers=[], sides=[], size='50'):
    """
    :param array: numpy array to be displayed as a HTML table
    :param headers: table headers for columns, default is no headers
    :param sides: table headers for rows, default is no headers
    :param size: string to set realtive table size in percent standard 50%
    :return: string containing a html table
    """
    n_cols = np_array.shape[1]
    n_rows = np_array.shape[0]
    local_text = "<table style=\"width:"+size+"%\">"
    if headers != []:
        if sides != []:
            headers.insert(0, "-")
        local_text += "<tr>"
        for element in headers:
            local_text += "<th>"+element+"</th>"
        local_text += "</tr>"
    for i in range(n_rows):
        local_text += "<tr>"
        if sides != []:
            local_text += "<th>" + str(sides[i]) + "</th>"
        for j in range(n_cols):
            local_text += "<td>" + str(np_array[i][j]) + "</td>"
        local_text += "</tr>"
    local_text += "</table>"
    return local_text