鉴于以下情况,我怎样才能将动物、年龄和性别放入每个表格单元格中?目前,所有数据最终都在一个单元格中。谢谢
from rich.console import Console
from rich.table import Table
list = [['Cat', '7', 'Female'],
['Dog', '0.5', 'Male'],
['Guinea Pig', '5', 'Male']]
table1 = Table(show_header=True, header_style='bold')
table1.add_column('Animal')
table1.add_column('Age')
table1.add_column('Gender')
for row in zip(*list):
table1.add_row(' '.join(row))
console.print(table1)