美文网首页
python各种方式打印表格

python各种方式打印表格

作者: _宋江_ | 来源:发表于2022-07-04 22:37 被阅读0次

https://stackoverflow.com/questions/9535954/printing-lists-as-tabular-data

prettytable可以使用属性:

table.SetRowLine(border)

table.SetRowSeparator("-")

https://pkg.go.dev/github.com/olekukonko/tablewriter@v0.0.0-20170122224234-a0225b3f23b5#section-readme

Example 4 - Custom Separator

table, _ := tablewriter.NewCSV(os.Stdout, "test.csv", true)

table.SetRowLine(true)        // Enable row line

// Change table lines

table.SetCenterSeparator("*")

table.SetColumnSeparator("‡")

table.SetRowSeparator("-")

table.SetAlignment(tablewriter.ALIGN_LEFT)

table.Render()

相关文章

网友评论

      本文标题:python各种方式打印表格

      本文链接:https://www.haomeiwen.com/subject/qlejbrtx.html