如果您阅读讨论
carefully,您会发现
UITABLE支持HTML内容……
这是一个例子:
X = rand(100,2);
%# convert matrix of numbers to cell array of strings (right aligned)
XX = reshape(strtrim(cellstr(num2str(X(:)))), size(X));
%# find cells matching condition
idx = ( X(:,1) > X(:,2) );
%# use HTML to style these cells
XX(idx,1) = strcat(...
'', ...
XX(idx,1), ...
'');
%# create table
f = figure;
h = uitable('Parent',f, 'Units','normalized', 'Position',[0.05 0.05 0.9 0.9]);
%# set table data
set(h, 'Data',XX)