xlsx-style包的文档是这样的:
说明1、
ws['!cols']: array of column properties objects. Column widths are actually stored in files in a normalized manner, measured in terms of the "Maximum Digit Width" (the largest width of the rendered digits 0-9, in pixels). When parsed, the column objects store the pixel width in the wpx field, character width in the wch field, and the maximum digit width in the MDW field.
说明2、
ws['!rowBreaks']: array of row break points, e.g. [16,32]
ws['!colBreaks']: array of col break points, e.g. [8,16]
比如我想设置第二列的宽度为100px,根据说明1的话我是这样写的(先设置第一列为一个空对象,然后设置第二列的宽度)
ws['!cols'] = ([ {}, { wpx: 100 } ])
ps:我在想有没有什么办法可以不用设置第一列为空对象,直接设置第二列的宽度呢?(“说明2”不知道怎么用)
同样设置某一行的高度也有此疑问。
慕尼黑8549860
相关分类