1

I know that can I can change the style of a whole row with like:

myTreeView.insert("", END, values = (25, -7, 30), tags = "mytag")

But how can I change the style of specific cells, so for example to use a red color only for negative numbers?

Is there something like:

myTreeView.tag_configure("neg", foreground = "red")
myTreeView.tag_configure("pos", foreground = "green")

myTreeView.insert("", END, values = (25, -7, 30), tags = ("pos", "neg", "pos"))   ???
OR
myTreeView.insert("", END, values = ((25, "pos"), (-7, "neg"), (30, "pos")))   ???

Oliver Hoffmann
  • 146
  • 2
  • 11
  • Does this answer your question? [ttk treeview: alternate row colors](https://stackoverflow.com/questions/7878730/ttk-treeview-alternate-row-colors) – Thingamabobs Oct 18 '20 at 09:59
  • Thanks, but No, as this applies styles to the whole row and not individual cells – Oliver Hoffmann Oct 18 '20 at 10:34
  • 2
    You cannot change the color of one single cell. See [this](https://stackoverflow.com/questions/48358084/how-to-change-the-foreground-or-background-colour-of-a-selected-cell-in-tkinter) for details. – Henry Yik Oct 18 '20 at 10:57

0 Answers0