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:
cell_cursor = table.cellAt(i, j).firstCursorPosition()
cell_cursor.setBlockFormat(centerFormat)
cell_cursor = table.cellAt(i, j).firstCursorPosition()
cell_cursor.setBlockFormat(centerFormat)
To copy to clipboard, switch view to plain text mode
Where:
centerFormat.setAlignment(Qt.AlignCenter)
centerFormat = QTextBlockFormat()
centerFormat.setAlignment(Qt.AlignCenter)
To copy to clipboard, switch view to plain text mode
I'm using PyQt.
Bookmarks