【发布时间】:2021-02-20 03:23:31
【问题描述】:
刚开始使用漂亮的表格包,在打印表格时,内容是一个字母一个字母地打印,而不是整个单词。当我运行示例代码时,列和行完全适合内容。我究竟做错了什么?请帮忙
table1 = BeautifulTable()
table1.rows.append([1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10])
table1.rows.append(f)
table1.rows.header = ["VR[V]", "Frequency[kHz]"]
table1.columns.header = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"]
print(table1)
table = BeautifulTable()
table.rows.append(["Jacob", 1, "boy"])
table.rows.append(["Isabella", 1, "girl"])
table.rows.header = ["S1", "S2"]
table.columns.header = ["name", "rank", "gender"]
print(table)
【问题讨论】:
标签: python python-beautifultable