An Introduction to the Table Class

The Table control is used to present a collection of objects or data in a grid-based (e.g. <table>) format. All Table objects take in a DataSource, which can be an array of anything (or in our example, an array of Person objects).

When creating a Table, you must create a table column for each column in your table. For each Column type you specify its name and how it should be rendered. In our example below, we create a CallableColumn column, which takes a PHP callable type, and lets you define a callback that will return the text of each cell in the column. The callback will be called repeatedly for each row in the table, and each time will be passed the data for the row it is to draw.

The Table's style is fully customizable, at both the column level and the row level. You can style the whole table with css, or specify classes for individual parts of the table. You can even specify how individual cells are drawn.

First NameLast Name
First Name is JohnLast Name Doe
First Name is KendallLast Name Public
First Name is BenLast Name Robinson
First Name is MikeLast Name Ho
First Name is AlexLast Name Smith
First Name is WendyLast Name Smith
First Name is KarenLast Name Wolfe
First Name is SamanthaLast Name Jones
First Name is LindaLast Name Brady
First Name is JenniferLast Name Smith
First Name is BrettLast Name Carlisle
First Name is JacobLast Name Pratt
First Name is 5Last Name 8
First Name is 5Last Name 8
First Name is 5Last Name 8
First Name is 57417Last Name 87887