# Can you vertically align wrapped text in a Power Table?

**URL:** <https://forum.inductiveautomation.com/t/can-you-vertically-align-wrapped-text-in-a-power-table/103732>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [March 14, 2025, 11:53pm UTC](https://forum.inductiveautomation.com/t/can-you-vertically-align-wrapped-text-in-a-power-table/103732 "2025-03-14T23:53:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Hathout\_Willar](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Simon\_Hathout\_Willar](https://forum.inductiveautomation.com/u/Simon_Hathout_Willar)\
**Post date:** [March 14, 2025, 11:53pm UTC](https://forum.inductiveautomation.com/t/can-you-vertically-align-wrapped-text-in-a-power-table/103732/1 "2025-03-14T23:53:34Z")

</div>

Hello.

Is there a way to vertically center text in a power table, while still letting it wrap?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/9/6976052491884106f1b26191192a306404cf0b4d.png)

It doesn't seem like this thread was able to find a solution [Power Table Wrap Text - #5 by bvaldovinos](https://forum.inductiveautomation.com/t/power-table-wrap-text/9256/5)

(as the other user said, using configureCell's  
`if colName == 'spec_description' : return {'verticalAlignment' : 2}`  
does not override the alignment)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 2, 2025, 5:06am UTC](https://forum.inductiveautomation.com/t/can-you-vertically-align-wrapped-text-in-a-power-table/103732/2 "2025-04-02T05:06:58Z")

</div>

Interestingly, simply returning the `'text'` property with html doesn't work; it just displayed the string with the html tags in the front. However, changing the text property of the renderer directly does produce the desired result.

**Example:**

```python
#def configureCell(self, [...], colView):
	# Wrap and center string text
	if self.table.getColumnClass(colView). __name__ == 'String':
	# Could be less genarically written as if colName == 'String Column': # or whatever the actual name ends up being
		
		# Set the alignment properties and inject HTML into the text
		renderer = self.table.defaultCellRenderer
		renderer.setHorizontalAlignment(renderer.CENTER)
		renderer.setVerticalAlignment(renderer.TOP)
		renderer.text = '<html><center>' + textValue
		
		# Return the modified renderer
		return {'renderer' : renderer}

```

**Result:**

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/4/041e71c09ca402d186d0f93ce12129cb25ffe45c.png)

---

<div class="post-metadata">

**Author:** ![Simon\_Hathout\_Willar](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Simon\_Hathout\_Willar](https://forum.inductiveautomation.com/u/Simon_Hathout_Willar)\
**Post date:** [April 2, 2025, 5:57pm UTC](https://forum.inductiveautomation.com/t/can-you-vertically-align-wrapped-text-in-a-power-table/103732/3 "2025-04-02T17:57:20Z")

</div>

> [@justinedwards.jle](#):
>
> ```python
> renderer = self.table.defaultCellRenderer
> renderer.setHorizontalAlignment(renderer.CENTER)
> renderer.setVerticalAlignment(renderer.TOP)
> renderer.text = '<html><center>' + textValue
> 		
> # Return the modified renderer
> return {'renderer' : renderer}
> 
> ```

As a note for anyone reading this,`renderer.setHorizontalAlignment(renderer.CENTER)` seems to affect cells with only one line, whereas `renderer.text = '<html><center>' + textValue` affects only cells with multiple lines.

So to left justify the text, I changed both from center to left.
