我想展示成这样:
---------------- | 名称 | ---------------- | 1 | 2 | ----------------
用下列代码写入:
sheet.write(0, 0, '名称') sheet.write(1, 0, 1) sheet.write(1, 1, 2)
但实际展示成了:
-------------------- | 名称 | | -------------------- | 1 | 2 | --------------------
求解
欢迎选择我的课程,让我们一起见证您的进步~~
stackoverflow上有个几乎相同的问题:http://stackoverflow.com/questions/19672760/how-to-write-a-cell-with-multiple-columns-in-xlwt
代码就是这样了:
sheet.write_merge(0, 0, 0, 1, 'Long Cell') sheet.write(1, 0, 1) sheet.write(1, 1, 2)
stackoverflow上有个几乎相同的问题:
http://stackoverflow.com/questions/19672760/how-to-write-a-cell-with-multiple-columns-in-xlwt
代码就是这样了: