EXCEL的高度和宽度计算

您所在的位置:网站首页 excel里的行高和列宽的单位是什么 EXCEL的高度和宽度计算

EXCEL的高度和宽度计算

2024-04-07 09:46| 来源: 网络整理| 查看: 265

Column width measured as the number of characters of the maximum digit width of the numbers 0, 1, 2, …, 9 as rendered in the normal style’s font. There are 4 pixels of margin padding (two on each side), plus 1 pixel padding for the gridlines. width = Truncate([{Number of Characters} * {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}256)/256 [Example: Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi). In fact, each digit is the same width for this font. Therefore, if the cell width is 8 characters wide, the value of this attribute must beTruncate([87+5]/7256)/256 = 8.7109375. end example] To translate the value of width in the file into the column width value at runtime (expressed in terms of pixels), use this calculation: =Truncate(((256 * {width} + Truncate(128/{Maximum Digit Width}))/256){Maximum Digit Width}) [Example: Using the same example as above, the calculation would be Truncate(((2568.7109375+Truncate(128/7))/256)7) = 61 pixels. end example] To translate from pixels to character width, use this calculation: =Truncate(({pixels}-5)/{Maximum Digit Width} * 100+0.5)/100 [Example: Using the example above, the calculation would be Truncate((61- 5)/7100+0.5)/100 = 8 characters. end example] [Note: when wide borders are applied, part of the left/right border must overlap with the 2 pixel padding on each side. Wide borders do not affect the width calculation of the column. end note] [Note: When the sheet is in the mode to view formulas instead of values, the pixel width of the column is doubled. end note] The possible values for this attribute are defined by the W3C XML Schema double datatype. 列宽度,以数字 0、1、…、9 的最大数字宽度的字符数度量,以普通样式的字体呈现。边距填充有 4 个像素(每侧两个), 加上网格线的 1 像素填充。 width = Truncate([{Number of Characters} * {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}256)/256 (公式-4) 示例:以 Calibri 字体为例,11 (pt)字体大小的最大数字宽度为 7 像素(在 96 dpi 时)。 因此,如果单元格宽度为 8 个字符宽,则此属性的值必须为 =Truncate([87+5]/7256)/256 = 8.7109375 在运行时将文件中的宽度值转换为列宽度值(以像素表示),使用此计算: =Truncate(((256 * {width} + Truncate(128/{Maximum Digit Width}))/256){Maximum Digit Width}) (公式-5) [示例:使用与上述相同的示例,计算将为Truncate(((2568.7109375+Truncate(128/7))/256)7) = 61 像素。 要从像素转换为字符宽度,请使用此计算: Truncate(({pixels}-5)/{Maximum Digit Width} * 100+0.5)/100 [示例:使用上面的示例,计算将为Truncate((61- 5)/7100+0.5)/100 = 8 个字符。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3