gpt4 book ai didi

java - POI 的 setColumnWidth -- 字符宽度?

转载 作者:行者123 更新时间:2023-11-30 07:08:05 26 4
gpt4 key购买 nike

public void setColumnWidth(int columnIndex,
int width)

Set the width (in units of 1/256th of a character width)

哪个字符的宽度的 1/256?不同的字符有不同的宽度。我在这里缺少什么?

最佳答案

如果你看HSSFSheet.setColumnWidth()方法的Javadoc,它有字符宽度的解释。粘贴以下摘录:

Character width is defined as the maximum digit width of the numbers 0, 1, 2, ... 9 as rendered using the default font (first font in the workbook). Unless you are using a very special font, the default character is '0' (zero), this is true for Arial (default font font in HSSF) and Calibri (default font in XSSF)

引用链接:http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFSheet.html#setColumnWidth(int, int)

关于java - POI 的 setColumnWidth -- 字符宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24313907/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com