# Question for string to color mapping in the dropdown list

**URL:** <https://forum.inductiveautomation.com/t/question-for-string-to-color-mapping-in-the-dropdown-list/28098>\
**Category:** Ignition\
**Created:** [September 9, 2019, 7:10am UTC](https://forum.inductiveautomation.com/t/question-for-string-to-color-mapping-in-the-dropdown-list/28098 "2019-09-09T07:10:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawei.liu](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@dawei.liu](https://forum.inductiveautomation.com/u/dawei.liu)\
**Post date:** [September 9, 2019, 7:10am UTC](https://forum.inductiveautomation.com/t/question-for-string-to-color-mapping-in-the-dropdown-list/28098/1 "2019-09-09T07:10:51Z")

</div>

Hi,

I want to implement a feature in dropdown list to choose different color such as green, red, blue.  
The drop-down list will show two columns, one column for the description of color, one column for the color itself. (Just like the number to color mapping as shown in below snapshot. We want to implement a string to color mapping in dropdown list).

But it seems that we can’t select “Color” type as a column in the dataset of dropdown list. So how could we achieve it? Is there any workaround?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7dc63d9500e0428e3478a835ff8208fe10e666e5.png)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 9, 2019, 12:04pm UTC](https://forum.inductiveautomation.com/t/question-for-string-to-color-mapping-in-the-dropdown-list/28098/2 "2019-09-09T12:04:24Z")

</div>

You can use html to color what amounts to a table cell. It's a bit old school, but it works.

`<html><table width=1000 height=1000><tr><td bgcolor=black><font color=black>X`

The 'X' at the end preserves the cell height when it displays.

A window to demonstrate. Note that I added a column to put a friendly name into, and a custom property to retrieve it:  
[test\_dropdown\_color\_2019-09-09\_0755.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5bae77a10102be41f4e957da4983a87c69b71300.zip) (4.0 KB)

Thread for reference. I had a similar issue with a table back in 2009. Fire up the wayback machine!

> [@Column color for table component](http://forum.inductiveautomation.com/t/column-color-for-table-component/1373):
>
> I can see where we can set the background color for a row, but not a column. Will this be something in the works, or will I just have to satisfy myself with changing the color of the text? Or-- even more likely-- am I missing something again? laughing

---

<div class="post-metadata">

**Author:** ![dawei.liu](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@dawei.liu](https://forum.inductiveautomation.com/u/dawei.liu)\
**Post date:** [September 9, 2019, 3:31pm UTC](https://forum.inductiveautomation.com/t/question-for-string-to-color-mapping-in-the-dropdown-list/28098/3 "2019-09-09T15:31:22Z")

</div>

@JordanCClark

Really appriciate your help, It works
