Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以,我得到了一张桌子(PrettyTable),我想让它们尽可能宽。例如,第一列的宽度应为 5px,第二列的宽度应为 18px,依此类推……我该怎么做?
PrettyTable_max_width可以改为以最大字符定义列/字段宽度。
_max_width
table._max_width = {"Field 1" : 50, "Field 3" : 25}
指定字段名称和它可以容纳的最大字符数;超出的字符换行到下一行。
未列出的字段仍将自动调整为长文本。