# Make Font Bold for selectedRow on Table component

**URL:** <https://forum.inductiveautomation.com/t/make-font-bold-for-selectedrow-on-table-component/5146>\
**Category:** Ignition\
**Created:** [September 14, 2012, 8:54am UTC](https://forum.inductiveautomation.com/t/make-font-bold-for-selectedrow-on-table-component/5146 "2012-09-14T08:54:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![skallepalli](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@skallepalli](https://forum.inductiveautomation.com/u/skallepalli)\
**Post date:** [September 14, 2012, 8:54am UTC](https://forum.inductiveautomation.com/t/make-font-bold-for-selectedrow-on-table-component/5146/1 "2012-09-14T08:54:35Z")

</div>

Dear Inductive Team,

We had a customer requirement where we need to make Font bold for selectedRow on Table Component. We see that Table has Selected Font color, Selected Background Color as properties for Table Component. However, they are particular about Font Bold as well.

We tried with following code on Table Mouse Pressed Event for a solution:

[code]# Get required variables.  
vTable = event.source  
vSelectedRow = vTable.selectedRow

# Remove Bold from all rows.

for col in range(vTable.data.columnCount):  
for row in range(vTable.data.rowCount):  
vVal = str(vTable.data.getValueAt(row, col))  
vVal = vVal.strip(’**’)  
vVal = vVal.strip(’**’)  
vTable.setValue(row, col, vVal)

# Make Selected Row Font Bold.

for row in range(vTable.data.columnCount):  
vValue = str(vTable.data.getValueAt(vSelectedRow, row))  
vValue = ‘ **’ + vValue + ‘** ’  
vTable.setValue(vSelectedRow, row, vValue)[/code]

However, As you can see from code - It will work only for String (Because you are appending **) Datatype columns. Not work for other datatypes (Integer, Date etc.).**

How we can resolve this requirement ?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [September 14, 2012, 9:23pm UTC](https://forum.inductiveautomation.com/t/make-font-bold-for-selectedrow-on-table-component/5146/2 "2012-09-14T21:23:54Z")

</div>

You are right, the tags only work for strings. However, there is a workaround. You can add another column to your dataset that is an integer. Hide the column so it is not visible to the user. In the event handlers, when the selected row changes you can set the integer column to 1 when selected and 0 when not selected. In the table customizer, you can put font mappings on each column based on the new integer column. So when the integer column is 1 you make the fonts bold and when 0 make them regular.

---

<div class="post-metadata">

**Author:** ![skallepalli](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@skallepalli](https://forum.inductiveautomation.com/u/skallepalli)\
**Post date:** [September 17, 2012, 10:14am UTC](https://forum.inductiveautomation.com/t/make-font-bold-for-selectedrow-on-table-component/5146/3 "2012-09-17T10:14:43Z")

</div>

Thank you Travis.

Let us put one more issue. The Dataset for Table component will change based on selection (in our case based on Radio Button selection). There are few columns which are common, few columns which are separate.  
Example: Dataset1 Columns = Col1, Col2, Col3, Hide (Column for Font bold)  
Dataset2 = Col1, Col3, Col6, Col7, Hide (Column for Font bold)

In this case, How we can set Font Map List ?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [September 17, 2012, 2:23pm UTC](https://forum.inductiveautomation.com/t/make-font-bold-for-selectedrow-on-table-component/5146/4 "2012-09-17T14:23:17Z")

</div>

Just make sure a row for each possible column exists in the “Column Attributes” dataset property. If the row with the same column name exists in there it will use that configuration. You can put the same translation lists on each column. You can add rows manually to the column attributes dataset.

---

<div class="post-metadata">

**Author:** ![skallepalli](https://avatars.discourse-cdn.com/v4/letter/s/54ee81/32.png) [@skallepalli](https://forum.inductiveautomation.com/u/skallepalli)\
**Post date:** [September 20, 2012, 3:46pm UTC](https://forum.inductiveautomation.com/t/make-font-bold-for-selectedrow-on-table-component/5146/5 "2012-09-20T15:46:19Z")

</div>

Thank you Travis.

We got our required solution.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 7, 2024, 8:57am UTC](https://forum.inductiveautomation.com/t/make-font-bold-for-selectedrow-on-table-component/5146/7 "2024-05-07T08:57:09Z")

</div>

Welcome to the forum, IFTIKHAR.

Did you notice that this thread was last updated twelve years ago in 2012?

I think you should delete your post and create a new thread.
