How to center-align uitable cells which are all numerical values?
Show older comments
I've found quite a few answers on this but they mostly discuss the strings. I have numerical values.
Some answers mention setting 'ColumnFormat' to 'bank' which a) doesn't seem to work for me, the cells remain right-align and b) this changes the format of the number where I'd like to keep the default formatting.
Does anyone have an advice on how to align numerical values in my uitable (I only have numerical values - no strings)?
Thank you in advance.
2 Comments
Why don't you use sprintf? Convert numbers to strings?
s = sprintf('a = %8.2f\n',1000*rand(10,1))
Milos Krsmanovic
on 19 Aug 2021
Edited: Milos Krsmanovic
on 19 Aug 2021
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!