-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot set culumn width #4102
Comments
You can set the column width, and, if you look at the xml for the spreadsheet, you'll see that all the columns have the width you've specified. The problem is that Excel then manipulates the value so that you see a different value in the Excel UI. <cols>
<col min="1" max="1" width="15" customWidth="true" style="0"/>
<col min="2" max="2" width="20" customWidth="true" style="0"/>
<col min="3" max="3" width="20" customWidth="true" style="0"/>
<col min="4" max="4" width="12.57" customWidth="true" style="0"/>
<col min="5" max="5" width="6.57" customWidth="true" style="0"/>
<col min="6" max="6" width="8.71" customWidth="true" style="0"/>
<col min="7" max="7" width="9" customWidth="true" style="0"/>
<col min="8" max="8" width="9" customWidth="true" style="0"/>
</cols> You can see this behavior in Excel without involving PhpSpreadsheet. Open a spreadsheet, set a cell, change its column width, save the spreadsheet. The value in the UI will not match the value in the xml. |
What the "width" represents is (taken from http://web.mit.edu/~stevenj/www/ECMA-376-new-merged.pdf):
If you take a look at your spreadsheet, and fill in, say, cell A4, you'll see that you can fit exactly 15 zero characters in it; in B4, you can fit exactly 20 zero characters, in G4, 9 characters, etc. This matches the integer widths you specified. In cell F4, you can fit 8 zero characters, but not 9; this accords with the width of 8.71 that you specified. |
HI , i try to set culumn width , this is my code :
` $mySpreadsheet = new Spreadsheet();
But if i see the culum width f.e. for culumn A hi have this :
instead of 15 .
the version is 2.0.1
The text was updated successfully, but these errors were encountered: