PowerTable Cell Border Color on tab or arrow key

I've done some searching on the forums and tried to use the configurecell functionality however, I can't seem to figure this out.

I am trying to change the color or thickness of the border when you click on a cell, but then tab or arrow to another cell. So, the selection is not in the cell. I know I can change the border once I am 'editing' the contents of a cell, but I can't figure out how to modify the border highlight when arrowing/tabing around on a table. I've included a screenshot of the tabbing/arrowing styling.

Thank you for any help!

You'll need custom properties to remember the row and column that you want to highlight regardless what is otherwise selected.

configureCell has a selected argument that does follow the arrowing, so if you're saying that you want the currently selected cell to have a thick border, the code would be written like this:

#def configureCell(self, [...], colView):
	if selected:
		from javax.swing import BorderFactory
		borderColor = system.gui.color('red')
		border = BorderFactory.createMatteBorder(4, 4, 4, 4, borderColor)
		return {'background': self.selectionBackground, 'border': border}
	elif rowView % 2 == 0:
		return {'background': 'white'}
	else:
		return {'background': 'lightgrey'}

Result:

However, custom properties would be needed if you are wanting the initially clicked cell to get a border and retain it while arrowing around the table.

Example:
add custom properties for clicked cells

Store the values using the onMouseClick extension function:

#def onMouseClick(self, [...], event):
	self.clickedRow = rowIndex
	self.clickedColumn = colIndex
	self.repaint() # This is needed to make configure cell repaint the entire table

Note: This is the extension function and not the event handler. The event handler won't register the clicked event in the inner table

Clear the selected values when appropriate using the propertyChange event handler:

if event.propertyName in ['selectedRow', 'selectedColumn'] and event.newValue == -1:
	event.source.clickedRow = -1
	event.source.clickedColumn = -1
	event.source.repaint() # Trigger configureCell extension function

Finally, in the configureCell extension function:

#def configureCell(self, [...], colView):
	if rowIndex == self.clickedRow and colIndex == self.clickedColumn:
		from javax.swing import BorderFactory
		borderColor = system.gui.color('red')
		border = BorderFactory.createMatteBorder(4, 4, 4, 4, borderColor)
		if selected:
			return {'background': self.selectionBackground, 'border': border}
		else:
			return {'border': border}
	elif selected:
		return {'background': self.selectionBackground}
	elif rowView % 2 == 0:
		return {'background': 'white'}
	else:
		return {'background': 'lightgrey'}

Result: after clicking cell (2, 1) and arrowing to cell (1, 2)