uitable different colors for row headers, resize row headers
3 views (last 30 days)
Show older comments
I have a uitable in a GUIDE gui. It has one column, and uses the row headers, so for example:
Thing1 0.0
Thing2 0.0
Thing3 0.0
Where Thing1,2,3 are the row headers, and 0.0's the first column cell contents.
I want to have each individual row header have a different background. One solution I have works:
rowName={'<font color=''white'' bgcolor="rgb(0,0,255)">Thing1</font>',...
'<font color=''white'' bgcolor="rgb(255,0,0)">Thing2</font>',...
'<font color=''white'' bgcolor="rgb(0,255,0)">Thing3</font>'};
set(handles.uitable,'RowName',rowName)
The problem is, the row header column width is made huge, overrunning, the first cell column (the one with the 0.0's). Is there any property I can add to the html<font> tags that will force the row headers to be narrower? I tried using "width", but that didn't work. I also tried "align", since the resulting rowName are all center aligned, and there is a lot of room on either side.
Open to other solutions also.
0 Comments
Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!