xlsx基础版本不能设置样式,所有需要使用xlsx-style替代npm install –save xlsx
复制代码//引入XLSXStyle
import XLSXStyle from 'xlsx-style'
- 1
- 2
设置字体,对齐,背景色
复制代码let style = {
// 表头样式
header: {
font: { sz: 10, color: { rgb: "ff0000" }, bold: true },
alignment: { horizontal: "center", vertical: "center", wrapText: true },
fill: { bgColor: { indexed: 64 }, fgColor: { rgb: "FFFF00" }},
},
// 内容样式
content: {
font: { sz: 11 },
alignment: { horizontal: "center", vertical: "center", wrapText: true },
},
// 注释行样式
trips: {
font: { sz: 10, bold: true },
alignment: { vertical: "center", wrapText: true },
fill: { bgColor: { indexed: 64 }, fgColor: { rgb: "00B050" }}
}
};
sheet['A1'].s = style.header;
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
如何利用PHPExcel类库建php将数据格式转为excel
上面是“vuejs导出excel设置字体,对齐,背景色”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_2113.html
workflows工作流
一桌精致的美食,桌上几杯白葡萄酒
树枝上一只色彩斑斓的小鸟
一个由红色玻璃制成的女性形状的破碎雕塑
彩色雄鹰玉雕ComfyUI工作流
一只可爱的草莓味冰淇淋卷筒
一朵由琥珀制成的孤独美丽的玫瑰
一把令人难忘的美丽吉他ComfyUI工作流
一只蚊子被嵌在琥珀中ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!