how to change nomber of rows in the ui table?
1 view (last 30 days)
Show older comments
how to change number of rows in the ui table, using GUIDE properties editor in the *.fig file?
2 Comments
Adam Danz
on 11 Jun 2019
The question was edited after it was answered. It's now clear that you want to add rows to your UI table from the GUIDE interface.
I'll update my answer to include those instructions.
Answers (1)
Adam Danz
on 10 Jun 2019
Edited: Adam Danz
on 17 Jun 2019
Add empty rows to the "data" property. Here's a demo.
data = get(handles.Table, 'Data'); % get the current data in your UItable
data{1,end+2} = []; %add two rows
set(handles.Table, 'Data', data); %assign the updated data back to your table
[update] There are several ways to add rows from the GUIDE interface. Right-click the UI table in GUIDE and select "Table Properties Editor".
One way is to select "Rows" on the left column; then "Show names entered below...." radio button, then use the "+ Insert" button to add rows; then "Apply".
Another way is to select "Data" on the left column; then "Change data value to the selected workspace...." radio button; and then select a workspace array that is the size you'd like.
Lastly, what I believe to be the simplest and cleanest option would be to set the "data" property from within the GUI code (follow the 3 lines of code I shared above). This could be done in the "guiName_OpeningFcn()" which is executed when the GUI is first created.
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!