el / canvas-table

Fast table implementation in Canvas
MIT License
68 stars 14 forks source link

added more style options for single cells #11

Closed njoylab closed 2 years ago

njoylab commented 2 years ago

Hi, thanks for sharing this cool project. For a personal project I have the need to customise a bit more the table, so I've added the possibility to specify custom cells in order to have for example a single cell with a different color or a different background.

I've added an example in the "test-account.png" test.

test-account

My TS skills are very basic, I don't know if it's something that could be useful for the project

el commented 2 years ago

Hello, thank you for taking the time to create a PR. I think this is a useful idea and I agree we should make it part of the package. However, instead of passing a custom object for customCells, we should update the data and pass the custom styles inside the data.

njoylab commented 2 years ago

Thanks for the feedback. It makes sense to have them in the data. I've added a new type to deal with the different type cast, not sure if there is a nicer way export type CTCellData = string | CTCustomCell;

njoylab commented 2 years ago

Thanks for the suggestions, my TS skills are very basic.

el commented 2 years ago

Thanks for the suggestions, my TS skills are very basic.

Thats OK :) Thanks for taking the time to create a PR