Change background color of specific uitable cell

Hi there,

I have created a GUI uitable. Consists on a nx3 table with user input values. How can I change the backgroud color of only one of the cells? BackgroundColor function changes the entire table background, which isn’t what I need. This is a dummy generic code, which I filled with random values.

Thanks a lot,

function MyTable
f = figure(‘Position’,[300 300 3000 400]);
% Column names and column format
columnname = {‘A’,‘B’,‘C’};
columnformat = {‘bank’,‘bank’,‘bank’};
% Define the initial displayed data
d = {randi([0 10],1,1) randi([0 10],1,1) randi([0 10],1,1);};
% Create the uitable
hTable = uitable(f,‘Position’,[0 0 3000 400],‘Data’, d,…
‘ColumnName’, columnname,…
‘ColumnFormat’, columnformat,…
‘ColumnEditable’, [true true true],…

I don’t think this is possible.

Octave does not currently implement the addStyle function that would let you change the properties of uitable cells individually through uistyle objects.

IIUC, uistyle in Matlab only works in uifigures. Octave doesn’t support those yet either.

Yes, this limitation in Matlab is probably due to some internal implementation constraint. In Octave there is no reason to have such limitation, is there?

Tbh, I’m not sure what the difference between figure and uifigure is in Matlab.
Is it just the same thing but with a different implementation backbone? Could we just treat uifigure as a synonym for figure? Or is there more to it?

IIUC, uifigure objects are the base widget of their App Designer tool while figure objects are not compatible. So this indeed looks like a different backend to do something similar.

I don’t know what their App Designer tool is used for.
But to return back on topic: We probably could have an uistyle function for uitables in figures if someone is interested in implementing this. IIUC, that would be a language extension. I don’t know if it would make sense to have it prefixed (oct_uistyle?) in that case.
But we could probably come back to this in case this gets actually implemented.

Yes, implementing a uistyle function would be ideal!