How do I resize the row name label width in a uitable (R2018b)?

조회 수: 15 (최근 30일)
Paul Smith
Paul Smith 2019년 8월 13일
편집: Adam Danz 2019년 8월 19일
Unable to locate the property or process to change the width of the name label column in a uitable. Seems to be locked out/hidden (is only automatically set)?
  댓글 수: 2
Adam Danz
Adam Danz 2019년 8월 13일
Maybe automatically set. What's the problem with the row name label width? You could put the row labels into their own column.
Paul Smith
Paul Smith 2019년 8월 13일
The name labels are pretty long, so it truncates the names. Yes, agree with you as a work around.

댓글을 달려면 로그인하십시오.

답변 (1개)

Hari Krishna Ravuri
Hari Krishna Ravuri 2019년 8월 19일
You can set the width of a column in the uitable to your desired value. You can specify the ColumnWidth property of a table by a cell array whose values are in pixel units. If you specify column width as ‘auto’, then MATLAB calculates the width of the column automatically using several factors, one of which is the ColumnName property value. If the cell array has fewer values than the number of columns, then the columns with no specified value keep the default value, ‘auto’. Please refer https://in.mathworks.com/help/matlab/ref/matlab.ui.control.tableappd-properties.html for more information regarding ColumnWidth property.
  댓글 수: 1
Adam Danz
Adam Danz 2019년 8월 19일
편집: Adam Danz 2019년 8월 19일
But the OP is asking how to control the width of the row name display which is not a column that is affected by the ColumnWidth property.
Here's a MWE. You'll see that the 3rd row name is cut off.
fh = uifigure();
ut = uitable(fh,'Position',[10,10,500,200]);
ut.Data = magic(3);
ut.RowName = {'LongNameNumberOne','LongNameNumberTwo','SuperRidiculouslyLongNameNumberThree'};

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by