Introduction to Tables
CreatiCode last edited by info-creaticode
You already know a list can store a sequence of numbers or text. Tables allow us to store multiple lists that are related. For example, suppose we need to store the IDs and names of 5 students. Instead of using 2 lists, it is better to use a table with 2 columns, so that it is clear which ID maps to which name.
To add a table, go to the “Variables” category, and click “Make a table”. You need to give the table a unique name, and also specify whether it is shared by all the sprites or only belongs to the selected sprite.
If you want to change the settings of the table, you can right-click on its name, then select “Rename table”.
To delete a table, you can right-click on its name, then select “Delete the xxx table”.
To add a new column to a table, click the grey “+” button. You can input a new column name, such as “Name” or “Age”, and then press ENTER to confirm.
When you click the dropdown button next to a column, there will be an option for you to rename that column.
Similarly, in the dropdown, there is an option for you to delete that column.
You can use the “+” button at the left bottom to add a new row. To remove a row, select that row first, then click the “x” button on the right.
You can select any cell to add data to it, just like with lists. Note that you can use the TAB key to jump to the next item.
You can use the + and - buttons next to the table name to change the size of the text.