找到pdfmake>build>pdfmake.js中:
找到定义的“TableProcessor.prototype.drawVerticalLine”和“TableProcessor.prototype.drawHorizontalLine”两个方法:
重新定义borderColor:
var borderColor = this.tableNode.table.borderColor||"#DBDBDB";
前端数据中设置如下:
{
table: {
headerRows: 1,
widths: [50, "*", 60, "*"],
borderColor:"#39f",//这样设置边框样式
body: [
[{ text: "服务监测报告",style:'header', colSpan: 4}, {}, {}, {}],
[{ text: "this.searchInformation.lysuoName", colSpan: 4, alignment: 'left',}, {}, {}, {}],
[
{ text: "序号", alignment: 'center', fillColor: '#91aadf' },
{ text: "项目", alignment: 'center', fillColor: '#91aadf' },
{ text: "金额", alignment: 'center', fillColor: '#91aadf' },
{ text: "备注", alignment: 'center', fillColor: '#91aadf' },
],
],
}
}
保存刷新即可
本站资源均来自互联网,仅供研究学习,禁止违法使用和商用,产生法律纠纷本站概不负责!如果侵犯了您的权益请与我们联系!
转载请注明出处: 免费源码网-免费的源码资源网站 » pdfmake不能设置表格边框颜色?
发表评论 取消回复