def listDictToHtmlTable(listDict):
    """return string containing html code for table"""
    result = '<table>'
    if len(listDict) > 0:
        result += '<thead><tr>'
        for key in listDict[0]:
            result += '<th>' + str(key) + '</th>'
        result += '</tr></thead><tbody>'
        for item in listDict:
            result += '<tr>'
            for key in item:
                result += '<td>' + str(item[key]) + '</td>'
            result += '</tr>'
        result += '</tbody>'
    result += '</table>'
    return result
