Click or drag to resize

IWorksheet SetColumnWidthInPixels Method

Sets column width in pixels.
Examples
The following code illustrates how to set width for a column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Set column width</para><para>worksheet.SetColumnWidthInPixels(2, 160);</para><para>//Save to file</para><para>workbook.SaveToFile("SetColumnWidthInPixels.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
void SetColumnWidthInPixels(
	int columnIndex,
	int value
)

Parameters

columnIndex
Type: System Int32
One-based column index.
value
Type: System Int32
Width to set.
See Also