# Table headers not centered

**URL:** <https://forum.inductiveautomation.com/t/table-headers-not-centered/19969>\
**Category:** Ignition\
**Tags:** ignition78\
**Created:** [October 3, 2018, 9:05pm UTC](https://forum.inductiveautomation.com/t/table-headers-not-centered/19969 "2018-10-03T21:05:21Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 4, 2018, 3:38pm UTC](https://forum.inductiveautomation.com/t/table-headers-not-centered/19969/5 "2018-10-04T15:38:47Z")

</div>

You’ll probably want this to fire automatically - probably on propertyChange of the `data` attribute, but this should get you started. `table.getColumnModel().getColumn(1)` sets the index of the column to modify (from 0, counting from left to right).

```auto
from javax.swing.table import TableCellRenderer

table = event.source.parent.getComponent('Table').getTable()

class NonSortableHeaderRenderer(TableCellRenderer):
	def getTableCellRendererComponent(self, table, value, selected, focused, row, col):
		renderer = table.getTableHeader().getDefaultRenderer()
		comp = renderer.getTableCellRendererComponent(table, value, selected, focused, row, col)
		comp.setIcon(None)
		return comp
		
table.getColumnModel().getColumn(1).setHeaderRenderer(NonSortableHeaderRenderer())

```

![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/dab6da755fd3414dbd30dff23659692503eadbc8.png)

---

_[View the full topic](https://forum.inductiveautomation.com/t/table-headers-not-centered/19969)._
