How can i do multi-line UITable cell
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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;
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!