Closed dmt0 closed 10 months ago
Here is two different ways, native or via CSS without !important https://jsfiddle.net/d82tg9qe/10/
jspreadsheet(document.getElementById('spreadsheet'), {
tabs: true,
toolbar: true,
worksheets: [{
minDimensions: [3,3],
style: { A1: 'text-align: left' },
data: [['native', 'external']]
}],
});```
```css
.jss > tbody > tr > td[data-x='1'] {
text-align: left;
}
Hi Paul, I'm not looking to set one cell. I want all cells by default to be aligned right if they are numbers, and left if they are stings. Exactly like Google Sheet.
All number columns are default align to the right, to change default aligment for text please use: defaultColAlign
Here is working example: https://jsfiddle.net/d82tg9qe/12/
I can't find a setting to change cell alignment. Can't set those with CSS either, cause I'd have to use
!important
which would make it impossible for users to set alignment from the toolbar. I would specifically want to change alignment for strings and numbers.