grid-js / gridjs

Advanced table plugin
https://gridjs.io
MIT License
4.39k stars 240 forks source link

Add column option for text justification so different columns can align differently? #1391

Closed jordanab closed 6 months ago

jordanab commented 11 months ago

I've been trying with no success to figure out how to do different text alignment for different columns. In my case, I want all the numeric columns right-justified and the rest left-justified.

I'd love it to be an option in the columns, just like we have 'width' to set different widths for different columns. For example,

columns: [{name: 'Facility name', width: '150px', align: 'left'}, {name: 'Output (tons)', width: '100px', align: 'right'}]

I can use 'text-align' for all td's under style, but I can't figure out how to do some columns left and others right. I have tried using the html formatting tool, but adding and other elements doesn't seem to be working for me because they don't access the itself.

Thanks so much for this tool! Sorry if my feature request is easily do-able already and I just haven't found out how.

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.