How to change horizontal alignment (left, right, center) of entries in a UITable
57 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 29 Oct 2019
Modifié(e) : MathWorks Support Team
le 26 Oct 2021
How do I center the data entries in my UITable?
Réponse acceptée
MathWorks Support Team
le 22 Oct 2021
Modifié(e) : MathWorks Support Team
le 26 Oct 2021
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!