필터 지우기
필터 지우기

How can i do multi-line UITable cell

조회 수: 5 (최근 30일)
Johnny Birch
Johnny Birch 2020년 5월 13일
편집: Johnny Birch 2020년 5월 14일
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개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by