필터 지우기
필터 지우기

uitable different colors for row headers, resize row headers

조회 수: 5 (최근 30일)
rmc256
rmc256 2012년 9월 25일
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