cancel
Showing results for 
Search instead for 
Did you mean: 

Adding css class to a button inside a table

mdixit_1401
Explorer
0 Kudos

Hi Experts,

I have a table in which one column is for quantity left. My requirement is in that column i need to show a small square with different borders like red for less than 500, green for more than 2000,etc.

For the square I thought of making a button of 16pxX16px but adding the margin based on data is the issue.

Please help me out with your suggestions over this.

Thanks,

Mansi

Accepted Solutions (1)

Accepted Solutions (1)

mdixit_1401
Explorer
0 Kudos

Hi Dennis & Sai,

Thank u so much for replying. Your codes are definitely a great help.

I just wanted to know that can I assign a complete css class conditionally to this button.

Coz in my case for some condition the box should be half filled and in some it is to be completely filled and in some it is to b transparent along with different borders. I have made classes but how do I assign those class itself to the button and not jst the border, conditionally.

Any Idea on this?

Thanks,

Mansi

former_member182862
Active Contributor
0 Kudos

HI Mansi

I have altered the JSBin to handle this

JS Bin - Collaborative JavaScript Debugging

mdixit_1401
Explorer
0 Kudos

Thanks Dennis... This worked perfectly for me

Answers (2)

Answers (2)

saivellanki
Active Contributor
0 Kudos

Hi Mansi,

Will this help? Plunker

Regards,

Sai Vellanki.

former_member182862
Active Contributor
0 Kudos