我想实现一下功能,每个大列表的小列表为一行数据
list1为必需材料
list2为选配材料
如何做出腿肿图片的样子
我自己能填充数据进去,但是做不到合并he单元格填充颜色和设置边框,最开始的文字居中也做不到
希望在fun函数中实现
表格模型
list1 = [[1,"单元板","/","/","/","/",5,10,50,""],
[2,"辅材","/","/","/","/",6,11,66,""],
[3,"电源","/","/","/","/",7,12,84,""],
[4,"控制卡","/","/","/","/",8,13,104,""],
[5,"处理器","/","/","/","/",9,14,126,""],
[6,"配电箱","/","/","/","/",10,15,150,""],
[7,"结构","/","/","/","/",11,16,176,""],
[8,"包边","/","/","/","/",12,17,204,""],
[9,"安装调试","/","/","/","/",13,18,234,""],]
list2 = [[1,"箱体","/","/","/","/",5,50,250,""]
[2,"多功能卡","/","/","/","/",6,51,306,""]
[3,"音箱、功放","/","/","/","/",7,52,364,""]
[4,"电脑","/","/","/","/",8,53,424,""]
[5,"运输","/","/","/","/",9,54,486,""]
[6,"施工平台","/","/","/","/",10,55,550,""]
[7,"综合布线","/","/","/","/",11,56,616,""]]
def fun(list1: list,list2: list,filename: str = "default.xlsx") -> None:
"""python
:param list1: 必须材料详细列表
:param list2:选配材料详细列表
:param filename:输出excel名字
:return:None
"""
pass
def main():
fun(list1,list2)
if __name__ == '__main__':
main()
预期运行后的结果