Center HTML text in QTextTable
I'm trying to make a header for a QTextTable. Everything is ok, except that I can't center the text inside the cell.
I've tried with "styles" trying to center the text (for example "style='text-align:center'"), but doesn't work.
I'm using HTML because I need to make several subscripts that I can't make with normal text.
How can I center the text? Any ideas?
Thanks!
Re: Center HTML text in QTextTable
Re: Center HTML text in QTextTable
I know, but this set the alignment for the table itself. I need to align the text inside the cells.
I think I solved the problem using:
Code:
cell_cursor = table.cellAt(i, j).firstCursorPosition()
cell_cursor.setBlockFormat(centerFormat)
Where:
Code:
centerFormat.setAlignment(Qt.AlignCenter)
I'm using PyQt.