Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
This lesson will show you how to create a bare bones data grid table. Data grid tables are useful when you need to display rows of data in structured columns.
Data Grid tables display data in columns that you can customize the look of. You don't have to worry about customization right now though because a Data Grid table can display plain text just fine. Let's test it out. 1) Switch to the Contents pane of the Object Inspector. 2) Type or paste some tab delimited text into the field. Click out of the field (in the Name field for example) to save the text you entered.
The tab delimited text you entered in the field will appear as columns in the data grid (1). The Object Inspector automatically creates a column in the Data Grid for each column in the text you provide (2).
Customizing Columns
Now that you've populate a Data Grid Table with some data let's look at the columns in the Data Grid. Normally when you work with a Data Grid Table you will create columns in the property inspector in advance using the "+" button (1). Seeing as the columns I need already exist I've gone through and renamed "Col 1" to "state" and "Col 2" to "code" (2). Note that I have assigned a label for the columns (3). Labels are useful for customizing the column labels in the Data Grid Table.
## data to appropriate columns. put "state" & tab & "code" & cr & \ "ALABAMA" & tab & "AL" & cr & \ "ALASKA" & tab & "AK" into theText ## Let Data Grid know that first line has column names put true into firstLineContainsColumnNames set the dgText [ firstLineContainsColumnNames ] of group "DataGrid 1" to theText end mouseUp Executing the above code would give you the following result in the Data Grid table.