如何在Golang中生成csv/excel,其中在该csv/excel中的某些列中将具有下拉选项,以便任何尝试添加/更新该列上的值的人都可以使用下拉列表中的可用值。
举例来说:在excel文件下方,航空公司列在下拉列表中列出了指定值。
P.S:下面的excel是在java中使用poi-4.0.0.jar库生成的
编辑1:我已经采取了不同的方法来解决上述问题,在这里分享https://go.dev/play/p/WD-qpXh6JNg
x1c 0d1x的数据
如何在Golang中生成csv/excel,其中在该csv/excel中的某些列中将具有下拉选项,以便任何尝试添加/更新该列上的值的人都可以使用下拉列表中的可用值。
举例来说:在excel文件下方,航空公司列在下拉列表中列出了指定值。
P.S:下面的excel是在java中使用poi-4.0.0.jar库生成的
编辑1:我已经采取了不同的方法来解决上述问题,在这里分享https://go.dev/play/p/WD-qpXh6JNg
x1c 0d1x的数据
3条答案
按热度按时间dohp0rv51#
试试看:
字符串
tquggr8v2#
Excel上的下拉列表是您可以使用此库的DataValidations:https://github.com/qax-os/excelize/
下面是一个简单的例子:
字符串
368yc8dk3#
正如@andrew-arrow所建议的,我看了一下tealeg库,我能够得到想要的结果,完整的代码是here。
再次感谢@andrew-arrow:)
字符串
output.xlsx x1c 0d1x的快照