Closed EP-Toushirou closed 4 years ago
This issue similar width #279, the column width in the Excel relate width DPI (Ref: Description of how column widths are determined in Excel, DPI and Device-Independent Pixels and ECMA 376 Part1 18.3.1.13). The SetColWidth
function in this library won't check DPI, the value of the column width will be set as is. So the same document will be shown differently on different OS and display devices. You need to calculate the width to fit the platform, for example, using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi)
SetColWidth("Sheet1", "A", "A", math.Trunc((10.75*7+5)/7*256)/256)
Thank you for your explain.I will check it again.🤝
Description Hello, SetColWidth's point is not same as the excel's point.
Describe the results you received:
Describe the results you expected: 10.75
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):