def createTable(values):
    """Creates a table from a list of one dimensional dicts. Keys of the first dict will be used as headings.
    :param values list woth dicts that only have one layer of dicts (subdicts lead to ugly results)
        and each dict needs to have the same keys or they won't be displayed or an error will be raised
    :returns: HTML table content that can be put into a HTML table tag
    """
    # table body
    tableMain = """
    <tr>
        %(heading)s
    </tr>
    %(content)s
    """

    # get all the keys from
    keys = [x for x in values[0].keys()]
    headings = ""
    for key in keys:
        headings += "<th>%s</th>" % key

    content = ""
    try:
        for dataset in values:
            content += "<tr>\n"
            for key in keys:
                if key == "bbox":
                    content += "    <td class='bbox'>%s</td>\n" % dataset[key]
                else:
                    content += "    <td>%s</td>\n" % dataset[key]
            content += "</tr>\n"
    except KeyError as e:
        raise KeyError("dicts must have the same keys")

    table = tableMain % {"heading": headings, "content": content}

    return table