フィルターのクリア

How to adjust the column width to the length of the data

17 ビュー (過去 30 日間)
Alvindra Pratama
Alvindra Pratama 2016 年 5 月 28 日
コメント済み: Alvindra Pratama 2016 年 5 月 29 日
i have a table in GUI like this ::
We can see that the width of the column does not correspond to the length of data in each column, especially the columns that appear Foto its data does not appear all, how can I adjust the length column with data automatically?

採用された回答

Geoff Hayes
Geoff Hayes 2016 年 5 月 29 日
Alvindra - you can manually set the pixel size for each column with the following line of code
set(handles.uitable1,'ColumnWidth',{50, 100, 150});
where the pixel widths of the first three columns 50, 100, and 150 respectively. In order to determine the pixel width of each column, you would need to determine the longest string in each column (in pixels). To determine the size, see Walter's answer at http://www.mathworks.com/matlabcentral/answers/56317-determine-size-of-text-objects.
  1 件のコメント
Alvindra Pratama
Alvindra Pratama 2016 年 5 月 29 日
Thank you so much, you are really help me, thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by