uitable different colors for row headers, resize row headers

5 次查看(过去 30 天)
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 个)

类别

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