在angularjs中下载时如何增加Excel宽度 [英] how to increase the excel width while download in angularjs
问题描述
大家好,我正在使用 angularjs
excel下载功能,它工作正常,但我需要在下载excel时增加excel列的宽度.我在这里附上小提琴来帮助任何人如何解决这个问题
hi all i am using angularjs
excel download functionality it's working fine but i need to increase the excel column width while downloading excel. help anyone how to solve this problem here i attached fiddle
excel下载小提琴: https://jsfiddle.net/x30v0bym/3/
excel download fiddle: https://jsfiddle.net/x30v0bym/3/
推荐答案
您可以使用HTML样式来编辑宽度/任何内容,并在导出时将这些样式应用于最终的Excel文件.
You can use HTML styles to edit the width/anything, and on export these styles will be applied to the final Excel file.
因此,添加到您当前的小提琴中..
So by adding to your current fiddle..
<th style="width:200px;">Name</th>
<th style="width:500px;">Email</th>
您实际上将完成您想要的工作.
You'll actually accomplish what you're trying to.
检查此小提琴: https://jsfiddle.net/8emjab42/
导出的文件将保留您在HTML中应用的所有样式.
The exported file will carry over any styles you apply to it in the HTML.
等等,我看到您说正在下载" –这是否意味着您不想要在导出之前应用样式?有点不清楚.
Wait, I see you say "while downloading" -- does this mean you don't want the styles applied until the export? Slightly unclear.
这篇关于在angularjs中下载时如何增加Excel宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!