How to change horizontal alignment (left, right, center) of entries in a UITable
62 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2019-10-29
编辑: MathWorks Support Team
2021-10-26
How do I center the data entries in my UITable?
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!