add_format(page_header_format)
workbook.add_format(player_name_format)
workbook.add_format(header_format)
workbook.add_format(data_format)
worksheet.format_column(0, 35, data_format)
This code creates a number of formats and adds them to the workbook. You need to
add them before you can use them later, because formats are specific to the entire document
and then referenced when used. Next, you proceed to format the first column using
the format_column method, passing three parameters:
??? The first parameter specifies which column to format; in this case, column 0, or the
first column.
??? The second parameter specifies the width of the column; in this case, 35, which is
wide enough to display all of the data in that column.
??? The third parameter is a display format for the column; in this case, data_format.
An astute observer may notice that the data_format format contains no specific formatting,
so it is not any different from an unformatted cell. This is intentional; the
format_column method can, in theory, set just a column width without setting a format,
but due to a bug, the library will crash if a format is not specified.
Pages:
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100