Skip to content
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

Auto-alignment, auto-size cells #12

Open
ndrogers opened this issue Jan 23, 2020 · 2 comments
Open

Auto-alignment, auto-size cells #12

ndrogers opened this issue Jan 23, 2020 · 2 comments

Comments

@ndrogers
Copy link
Collaborator

Options should be provided to automatically align columns, rows, or both in tandem.

@ndrogers
Copy link
Collaborator Author

ndrogers commented Feb 26, 2020

@PaulMansour @mkromberg
Auto alignment of columns appears to be done by Excel, by measuring a specific width, not as a property of a column.

  <cols>
    <col min="1" max="1" width="18.453125" bestFit="1" customWidth="1"/>
    <col min="2" max="2" width="27.81640625" bestFit="1" customWidth="1"/>
    <col min="3" max="3" width="28.453125" bestFit="1" customWidth="1"/>
  </cols>

Attempting to include bestFit without the customWidth and width properties reduce the columns to a width of 0. I am unclear at this time how to calculate the width property.

<cols>                                                     
  <col min="1" max="1" bestFit="1" customWidth="1"></col>  
  <col min="2" max="2" bestFit="1" customWidth="1"></col>  
  <col min="3" max="3" bestFit="1" customWidth="1"></col>  
</cols>                                                    

<cols>                                     
  <col min="1" max="1" bestFit="1"></col>  
  <col min="2" max="2" bestFit="1"></col>  
  <col min="3" max="3" bestFit="1"></col>  
</cols>   

@PaulMansour
Copy link
Contributor

Ok, given the XML, I think we should just have a ColumnWidths property of the range object, and leave setting the size up to the user. Each element is the width of the corresponding column in the range. It looks like the actual value unit is the width of single (average) char in the default font. So for a 10 digit number, one might set it to 11, or, say, 13 or 14 to handle commas, dollar signs., etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants