Can I freeze first row and/or column in uitable?

23 visualizaciones (últimos 30 días)
Mark Golberg
Mark Golberg el 1 de Sept. de 2020
Respondida: Erica el 24 de Oct. de 2023
Hey,
can I freeze first row and/or first column in a uitable? Similar to what exist in excel - freeze pane.
Adding 2 uitables one on top of the other doesn't seems to work (scroll bar appears, etc... unless i'm doing it incorrectly).
I'm using Matlab 2015a.
Thanks for the help!
Mark
  1 comentario
Adam Danz
Adam Danz el 1 de Sept. de 2020
Matlab doesn't have an option like that.
I would suggest doing what you've already tried: create 2 tables: one for the column (or row) headers and one for the data. The scroll bar appears when the size of the uitable doesn't match the size of the data, I believe. So, your headers table should only have 1 row (or 1 column) of data.

Iniciar sesión para comentar.

Respuestas (2)

Mario Malic
Mario Malic el 1 de Sept. de 2020
I am also not familiar with the freeze panel. To eliminate the scrolling effect in UITable, set your ColumnWidth values to desired width, and parameter Width in Position to be higher by 2 or 3 pixels than the total width. At least, this is what works in my case, maybe this is monitor resolution dependant.
Example: for a table with 5 columns and 50 pixel width each, Position should be [x y 253 h].

Erica
Erica el 24 de Oct. de 2023
It is not a perfect solution. However, you can use the RowName for 'freezing' the first column.
fig = uifigure;
T = uitable(fig);
M = magic(50);
T.Data = M;
T.RowName = M(:,1);
T.ColumnSortable = true;

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by