Easy way to change foreground color into a single uitables´s cell

3 次查看(过去 30 天)
Hello,
this time I have an uitable, filled with some data. I would like to be able to change the foreground color of some particular cells inside the uitable. For instance, if the values represented on one column are under a certain value, they should be written in black, otherwise if they are over the threshold they should be printed in blue inside the cell.
I have checked the documentation but I cannot find something helpful, and seem like the 'ForegroundColor' property is only affecting the whole uitable 'data' but not single cell elements.
I know that this could be possible managing some java code, but I am not that close to that world.
Can someone help me?

采纳的回答

Jan
Jan 2011-9-8
Please read this thread: CSSM: Yair's cell renderer
TMW suggests using HTML tags to change the foreground color: Solution D782JW
  1 个评论
Giovanni
Giovanni 2011-9-12
Thanks! That is exactly what I was needing. I decided to use the xml approach.
Is there then a way to aling the text on the right side? Unfortunately I´m not a lot in xml, and I don´t know how to get this in Matlab.
How can I modify the function in order to put the xml colored text on the right side of my cell?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by