PennController.AddTableGlobal Commands

PennController.AddTable( name, csv_string )

You can use this command to manually define a table to use with PennController.Template. You normally do not need to use this command since, as of PennController beta 0.4, you can directly upload your CSV file under chunk_includes.

Example:

[js highlight=”1-5″ try=”data”]
PennController.AddTable( “myTable”, // Name of the table
“Type,Sentence\n”+ // Column names (mind the \n)
“practice,Hello world!\n”+ // First row (mind the \n)
“test,Bye world!” // Second row
);

PennController.Template( “myTable” ,
row => PennController(
newText(“type”, row.Type)
.print()
,
newButton(“sentence”, row.Sentence)
.print()
.wait()
)
);
[/js]