Class Grid


Deprecated. The UI service was deprecated on December 11, 2014. To create user interfaces, use the HTML service instead.

A rectangular grid that can contain text, html, or a child widget within its cells. It must be resized explicitly to the desired number of rows and columns.

Here is an example of how to use this widget:


 function doGet() {
   var app = UiApp.createApplication();
   app.add(app.createGrid(3, 3)
       .setText(0, 0, "X")
       .setText(1, 1, "X")
       .setText(2, 2, "X")
       .setText(0, 1, "O")
       .setText(0, 2, "O")
       .setStyleAttribute(0, 0, "color", "red")
       .setStyleAttribute(1, 1, "color", "red")
       .setStyleAttribute(2, 2, "color", "red")
       .setStyleAttribute(0, 1, "color", "blue")
       .setStyleAttribute(0, 2, "color", "blue"));
   return app;

Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation directly. You can find the Grid documentation here.

Deprecated methods

Send feedback about...

Apps Script