dohooo / react-native-table-component

🌱Build table for react native
MIT License
733 stars 189 forks source link

Make it possible to give different styles to each cell in a row #125

Closed freechelor closed 1 year ago

freechelor commented 4 years ago

I found that I couldn't make each cell have different styles.

When somebody wants to make tables, they would like some columns in numbers, e.g. sales amount which could be important so in bold and large font, on the other hand, other columns like dates in just normal font and size.

plnii commented 3 years ago

I wanted the same feature. I liked the array based method of this approach, but found it wasn't very friendly for generic styles for the cells. So I rewrote line 21 of the code to:

const cellTextStyle = textStyleArr ? {...textStyle, ...textStyleArr[i]} : textStyle; This treats the textStyleArr as overrides on the normal textStyle, enabling you define way less in the textStyleArr