/ LJCPHPCodeDoc / LJCHTMLTableLib / LJCHTMLTable / CollectionHTML


Parameters
$dataItems - The collection of data objects.
$textState - The text state object.

Returns

The HTML table.

Syntax

PHP
public function CollectionHTML(LJCCollectionBase $dataItems
, LJCTextState $textState): string

Create an HTML table from an Collection Object.

Example

PHP
 // Get Collection data table.
 private static function GetCollectionTable(LJCTextState $textState)
 {
   $dataItems = new LJCAttributes();
   $dataItems->Add("border", "1");
   $dataItems->Add("cellspacing", "2");
   $propertyNames = [
     "Name",
     "Value",
   ];
 
   $ht = new LJCHTMLTable();
   $ht->ColumnNames = $propertyNames;
   $tb = new LJCTextBuilder();
   $ht->TableAttribs = $tb->TableAttribs();
   $result = $ht->CollectionHTML($dataItems, $textState
     , $propertyNames);
 }

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.