Click or drag to resize

XlsWorksheet SetColumnWidthInPixels Method (Int32, Int32)

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.Spreadsheet
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
public void SetColumnWidthInPixels(
	int iColumn,
	int value
)

Parameters

iColumn
Type: System Int32
One-based column index.
value
Type: System Int32
Width in pixels to set.

Implements

IWorksheet SetColumnWidthInPixels(Int32, Int32)
See Also