Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Introduction to Tables

    2D Blocks
    1
    1
    454
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by admin

       

      Description

       
      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.

      Each row in a table represents an object: for example, the first row says there is a student with the ID of 1 and a name of Adam.

      684c9fc9-3614-4f69-919e-411d31fe4877.png

       
       

      Adding a Table

       
      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.

      b2c2c5b8-c34e-4885-961e-c61368de3104.gif

         

      Renaming a Table

       
      If you want to change the settings of the table, you can right-click on its name, then select “Rename table”.

      5e10599c-e35a-44d4-85af-1edea5648993.gif

       
       

      Deleting a Table

       
      To delete a table, you can right-click on its name, then select “Delete the [censored] table”.

      6744afcd-878e-43a4-90fa-66207253de45.gif

       
       

      Adding Columns

       
      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 the ENTER key to confirm.

      baba92d1-e5c4-4872-8400-9a11e34e8767.gif

       
       

      Renaming a Column

       
      When you click the dropdown button next to any column, there will be an option for you to rename that column.

      3ac52b79-7f2c-4cdf-b788-b6b2294bfce9.gif

       
       

      Deleting a Column

       
      Similarly, in the dropdown, there is an option for you to delete that column.

      3f8335f0-843e-4551-91e8-8037a45253ef.gif

       
       

      Adding and Removing Rows

       
      You can use the “+” button at the bottom left to add a new empty row. To remove a row, select that row first, then click the “x” button on the right.

      17e3ef3a-8c49-4f6e-8452-069d48c1839b.gif

       
       

      Adding Data

       
      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 following item.

      42409da4-561c-425e-ae1b-100b126e5e55.gif

       
       

      Changing Text Size

       
      You can use the + and - buttons next to the table name to change the size of the text.

      1765216e-6d34-41a5-93a3-8093abd32866.gif

       

      Learn More

       

      • Reading from a Table
      1 Reply Last reply Reply Quote 0
      • Pinned by  info-creaticode info-creaticode 
      • First post
        Last post