Click or drag to resize
NanoXLSX

Utils.GetInternalPaneSplitWidth Method

Calculates the internal width of a split pane in a worksheet. This width is used only in the XML documents of worksheets and is not exposed to the (Excel) end user

Namespace: NanoXLSX
Assembly: NanoXLSX (in NanoXLSX.dll) Version: 2.6.2+7f12a949130e0be1e987e553d2d08c083176cdca
Syntax
C#
public static float GetInternalPaneSplitWidth(
	float width,
	float maxDigitWidth = 7f,
	float textPadding = 5f
)

Parameters

width  Single
Target column(s) width (one or more columns, displayed in Excel)
maxDigitWidth  Single  (Optional)
Maximum digit with of the default font (default is 7.0 for Calibri, size 11)
textPadding  Single  (Optional)
Text padding of the default font (default is 5.0 for Calibri, size 11)

Return Value

Single
The internal pane width, used in worksheet XML documents in case of worksheet splitting
Remarks
The internal split width is based on the width of one or more columns. It also depends on the maximum digit width of the default font, as well as its text padding and various constants.
See also GetInternalColumnWidth(Single, Single, Single) for additional details.
This method is derived from the Perl implementation by John McNamara (https://stackoverflow.com/a/5010899)
See also: ECMA-376, Part 1, Chapter 18.3.1.13
The two optional parameters maxDigitWidth and textPadding probably don't have to be changed ever. Negative column widths are automatically transformed to 0.
See Also