# Formatting specific column in power table

**URL:** <https://forum.inductiveautomation.com/t/formatting-specific-column-in-power-table/60057>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [May 26, 2022, 12:31pm UTC](https://forum.inductiveautomation.com/t/formatting-specific-column-in-power-table/60057 "2022-05-26T12:31:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felipe\_Deolindo](https://avatars.discourse-cdn.com/v4/letter/f/6a8cbe/32.png) [@Felipe\_Deolindo](https://forum.inductiveautomation.com/u/Felipe_Deolindo)\
**Post date:** [May 26, 2022, 12:31pm UTC](https://forum.inductiveautomation.com/t/formatting-specific-column-in-power-table/60057/1 "2022-05-26T12:31:30Z")

</div>

Hello, I already have rows in power table that are with colors with this code :

```auto
	if selected:
		return {'background': self.selectionBackground}
	elif rowView % 2 == 0:
		return {'background': '237,239,243', 'foreground' : 'black' }
	else:
		return {'background': '176,183,196', 'foreground' : 'black' }

```

I would like to only paint the text in column 1 with red color using the same style above, I try this :

```auto
if colView == 1:
		return {'foreground' : 'red'}

```

but instead of painting just the text, and continuing to use the background color, the code has overwritten the style and kept the original background, is that a way to do this?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [May 26, 2022, 12:44pm UTC](https://forum.inductiveautomation.com/t/formatting-specific-column-in-power-table/60057/2 "2022-05-26T12:44:18Z")

</div>

When you get into more complex configurations, your best bet is to use overrides.

```auto
attributes = {'foreground': 'black', 'background': '176,183,196'}

if colView == 1:
	attributes ['foreground'] = 'red'
	
if selected:
	attributes ['background'] = self.selectionBackground
elif rowView % 2 == 0:
	attributes ['background'] = '237,239,243'
	
return attributes 

```

---

<div class="post-metadata">

**Author:** ![Felipe\_Deolindo](https://avatars.discourse-cdn.com/v4/letter/f/6a8cbe/32.png) [@Felipe\_Deolindo](https://forum.inductiveautomation.com/u/Felipe_Deolindo)\
**Post date:** [May 26, 2022, 12:52pm UTC](https://forum.inductiveautomation.com/t/formatting-specific-column-in-power-table/60057/3 "2022-05-26T12:52:23Z")

</div>

> [@dkhayes117](#):
>
> ```python
> attributes = {'foreground': 'black', 'background': '176,183,196'}
> 
> if colView == 1:
> attributes ['foreground'] = 'red'
> 	
> if selected:
> attributes ['background'] = self.selectionBackground
> elif rowView % 2 == 0:
> attributes ['background'] = '237,239,243'
> 	
> return attributes 
> 
> ```

really thanks, works perfectly
