I need to create a table like this
how can I align first column left, 2nd and 3rd columns center, and last column right sothat when someone put data in, it is automatically aligned as I want ?
My first code:
ui->tableWidget->setColumnCount(4);
ui->tableWidget->setRowCount(52);
ui->tableWidget->setHorizontalHeaderLabels(QStringList() << tr("Name") << tr("Age") << tr("Position") << tr("Salary"));
I know we have something like
ui.tableWidget->item(i, 0)->setTextAlignment(Qt::AlignLeft);
But i don't know how to set it for every row of a column.
Many thanks !