CTable 1.0

To use CTable, simply create an instance of it, like so:
$table = new CTable();

You will then need to assign the number of rows for the class, this is done using the Rows() method, like so:
$table->Rows(5);

You will also need to define the number of cells for the table, in much the same way you define the Rows, using the Cells() method, like this:
$table->Cells(10);

You can now set the data contained within the cells, like this:
for($x=1;$x<=$table->GetRows(); $x ) {
for($y=1;$y<=$table->GetCells(); $y ) {
$table->SetData("x($x) y($y)", $x, $y);
}
}

The above is a loop that fills each cell in the table with the row and cell number ... the output should look similiar to this:
x(1) y(1) | x(1) y(2) | x(1) y(3)
x(2) y(1) | x(2) y(2) | x(2) y(3)
x(3) y(1) | x(3) y(2) | x(3) y(3)

After you have placed data within the table, you must then Generate() it for it to be displayed on the screen. This is done with the Generate() method, like so:
$table->Generate();
You may additionally free up some memory, by calling the Release() method, like so:
$table->Release();


ADDITIONAL FEATURES:
You may wish to alter the table's class, border, width, cellpadding, cellspacing, or possibly its style attribute. You can do this using either the setHeader() method, or by calling the setClass, setBorder, setWidth, setCellpadding or setCellspacing methods, similiar to this:

$table = new CTable();
// setHeader must be called before any other Header methods
// setHeader rewrites the current Header, this is why!
$table->setHeader('style="border: thin solid red"');
$table->setCellspacing(5);
$table->setCellpadding(0);
$table->setBorder(1);
$table->Rows(5);
$table->Cells(2);
$table->SetData("TEST", 1, 2);
$table->Generate();
$table->Release();
unset($table);

License type: Freeware
Date added: 5 years, 11 months 22 days ago | Last updated: 5 years, 11 months 22 days ago

More popular HTML

This is actually one of the most advanced image hosting script. The imagetize key features: SEO, Ads Ready, Admin

Listing Files

ctable
Hot Scripts
Sponsors