Column width in uitable
이전 댓글 표시
Hi,
if I press button, then new figure appears with uitable. Column width is always the same. How can I change column width? Or if I change column width manually by mouse and then I press button, then I wont to have width from mouse.
Thank you
Me code:
t = uitable('Parent',f,'Data',result,'Position',[10 10 630 400],'ColumnWidth','auto','RowName',rnames,'Columneditable',coleditable,'ColumnFormat',{'char', 'char', 'char', 'char', 'char', 'char'});
답변 (1개)
Jan
2013년 9월 12일
0 개 추천
I'm not sure if I understand your question.
You can change the columnwidth by not setting it to 'auto' but manually by a cell, which contains the width values. See http://www.mathworks.com/help/matlab/ref/uitableproperties.html#brgovhi.
You cannot obtain the changed width values as far as I know.
댓글 수: 11
john
2013년 9월 12일
Jan
2013년 9월 12일
I do not understand the problem. What does "always the same" mean? Under which conditions? What do you expect and what do you see?
john
2013년 9월 14일
Jan
2013년 9월 15일
I still do not understand, what "always" mean. Which different situations did you test to determine this "always"?
From the documentation of uitable:
If ColumnWidth is a cell array and the width of a column is set to 'auto' or if auto is selected for that column in the Property Inspector GUI for columns, the column width defaults to a size determined by the table. The table decides the default size using a number of factors, including the ColumnName and the minimum column size.
john
2013년 9월 15일
john
2013년 9월 16일
@John: I have no idea how I could bring you to answer my question, what you mean by "always". The message, that "items in the uitable are cell array" is not useful, because on one hand there are many different "item" and it is not clear which one you mean, on the other hand "items" did not play any role in the current question. Using the ColumnWidth 'auto' does apply an automatic scaling of the column width already, but it seems like you want to behave it in another way. As long as you do not explain, which behavior you expect under which conditions, I do not see any chance to discuss this further.
Please do not post fragments of commands, but the complete command. Then it would be clear, if you define the "100" with or without quotes. With quotes it would be a string, but according to the documentation you need a number.
I'd really want to assist you, so please take into account, that I do not have a crystal ball and cannot guess, what you mean and want.
john
2013년 9월 16일
Jan
2013년 9월 16일
What does "length" mean? Perhaps you mean the extent of the string when written to the screen? "Lengths of cells" is at least a confusion formulation.
Please, John, do not let us guess the details.
john
2013년 9월 18일
john
2013년 9월 23일
카테고리
도움말 센터 및 File Exchange에서 Labels and Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!