是否可以在python中过滤搜索用tablate()创建的表(HTML格式)?

2024-04-28 09:27:23 发布

您现在位置:Python中文网/ 问答频道 /正文

是否可以在python中对tablate()创建的表(HTML格式)进行过滤搜索?我正在将一个制表的表格闪现到一个HTML页面中,并希望在其中加入一个搜索过滤器

我当前制作和刷新表格的代码:

def history():

    listOfFiles = os.listdir(VERIFIED_FILE_PATH)
    newList = []
    for file in listOfFiles:
        raw_name = stripExtension(file)
        raw_name = stripDate(raw_name)
        fileType = getFileType(raw_name)
        coID = getCoID(raw_name)      
        newList.append([raw_name, fileType, coID, dateUploaded(file)])
    listTable = tabulate(newList, headers = ['File','Type','CompanyID','Upload Date and time'],tablefmt='html')
    flash(listTable)
    return render_template('history.html')

我正在将表格刷新到history.html


Tags: namerawhtml格式history表格filefiletype