简体   繁体   English

如何将电子表格中的列宽设置为特定的像素数(Aspose Cells)?

[英]How can I set the column width in a spreadsheet to a specific pixel count (Aspose Cells)?

I am setting the width of a column this way: 我这样设置列的宽度:

private static readonly int RESTAURANT_LOCATION_COLUMN_WIDTH = 28;
. . .
deliveryPerformanceWorksheet.Column(RESTAURANT_LOCATION_COLUMN).Width = RESTAURANT_LOCATION_COLUMN_WIDTH;

The end user wants the width to be precisely 225 pixels. 最终用户希望宽度精确为225像素。

The width value is obviously not in pixels; 宽度值显然不是以像素为单位; is there some calculation for converting the value used to pixels to cause the value assigned to equate to a specific pixel count? 是否有用于将用于像素的值转换为等于指定像素数的值的计算?

容易食用醋栗派:

deliveryPerformanceWorksheet.Cells.SetColumnWidthPixel(RESTAURANT_LOCATION_COLUMN, 225);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在电子表格范围(Aspose Cells)周围添加边框? - How can I add borders around a spreadsheet range (Aspose Cells)? 将图像放在电子表格(Aspose Cells)上时,如何防止图像尺寸改变? - How can I prevent my image from changing size when placing it on a spreadsheet (Aspose Cells)? 如何在计算出的像元(Aspose Cells)中防止“#Div / 0!”? - How can I prevent “#Div/0!” in calculated cells (Aspose Cells)? 如何覆盖数据透视表(设置单元格)上的列标签文本? - How can I override the column label text on a Pivot Table (Aspose Cells)? 如何设置aspose单元格以从OS中获取日期格式的语言环境? - How can I set aspose cells to take the locale for date format from OS? 如果不同的单元格是特定值,我怎么才能计算单元格? - How can I only count cells if a different cell is a specific value? 如何计算电子表格中的单元格对 - How to count pairings of cells in spreadsheet xlsx4j-如何在电子表格中设置列宽? - xlsx4j - How to set column width in spreadsheet? 如何确定数据透视表生成多少行(Aspose Cells)? - How can I determine how many rows a PivotTable generates (Aspose Cells)? 如何用不同的值代替自动生成的总计值(Aspose Cells)? - How can I replace automatically-generated grand total values with different ones (Aspose Cells)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM