How to change horizontal alignment (left, right, center) of entries in a UITable

조회 수: 62 (최근 30일)

채택된 답변

MathWorks Support Team
MathWorks Support Team 2021년 10월 22일
편집: MathWorks Support Team 2021년 10월 26일
In MATLAB R2019b, there is a new feature called a UI style: 
Style objects are used to create color, font, and alignment styles for cells in table UI components. You can add Style objects to a specific UI component by using the "addStyle" function:
For example, if I wanted to center all the data entries in my UI table, I would do the following:
>> A = [1;2;3]; B = {'a';'b';'c'};>> f = uifigure;>> t = uitable(f,'Data',table(A,B));>> s = uistyle('HorizontalAlignment','center');>> addStyle(t,s,'table','');
See the above documentation links for more examples.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by