C++ (Qt)#include <QtGui>#include <QApplication> int main(int argc, char **argv){ QApplication app(argc, argv); QTableWidget table(10, 10); QPalette pal(table.horizontalHeader()->palette()); pal.setColor(QPalette::Button, Qt::red); table.horizontalHeader()->setPalette(pal); for (int row = 0; row < table.rowCount(); ++row) { for (int column = 0; column < table.columnCount(); ++column) { QTableWidgetItem *newItem = new QTableWidgetItem(QString("%1").arg((row+1)*(column+1))); table.setItem(row, column, newItem); } } table.show(); return app.exec();}