Clear Filters
Clear Filters

How can i do multi-line UITable cell

5 views (last 30 days)
Johnny Birch
Johnny Birch on 13 May 2020
Edited: Johnny Birch on 14 May 2020
I am creating a UItable with newline between strings in table cells, for instance "06↵07↵08↵09". How can I have a line shift within a cell in a UITable?
Below is a very simple code example of my issue.
%Prepare data example
Data = {'01','02','03','04','05';'a','b','c','d','e';'','','a1','b2',''};
%preallocate
MainTable = array2table(strings(5,1));
testarray = strings(5,3);
%insert data in testarray
for i = 1:5
for j = 1:3
testarray(i,j) = Data(j,i);
end
end
%prepare array into one column and insert in MainTable
newStr = join(testarray);
newStr = strtrim(newStr);
newStr = strrep(newStr , " ", newline);
MainTable{:,1} = newStr;

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!