title: QTableWidget set the Background of header Cell
body: <p>I know how to set the Horizontal Headers background color, but how can i set the Headers Background Color for a specified Row? In this example, say i want to have the Header Row with the Label <strong>"3"</strong> to be red?</p>
  
  <p><a href="https://i.stack.imgur.com/iYKQx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iYKQx.png" alt="enter image description here"></a></p>
  
  <p>The above screenshots code:</p>
  
  <pre><code>import sys
  from PyQt4 import QtCore, QtGui
  from PyQt4.QtGui import *
  
  
  
  class Example(QtGui.QWidget):
  
      def __init__(self):
          super(Example, self).__init__()
          self.initUI()
  
  
      def initUI(self):
          self.setGeometry(300, 300, 250, 150)
          self.rigTable = QTableWidget(1, 3, self)
          style = "::section {""background-color: lightblue; }"
          self.rigTable.horizontalHeader().setStyleSheet(style)
          self.rigTable.setShowGrid(False)
  
          self.rigTable.setCellWidget(0, 0, QLabel("A"))
          self.rigTable.setCellWidget(0, 1,  QLabel("B"))      
  
          self.show()
  
  
  def main():
      app = QtGui.QApplication(sys.argv)
      ex = Example()
      sys.exit(app.exec_())
  
  
  if __name__ == '__main__':
      main()
  </code></pre>