How can i do multi-line UITable cell
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(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!