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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!