<?php
use alesinicio\HTMLTable;
require "../HTMLTable.php";
$arrHeaders = array(
"First column", "Second column", "Third column", "Fourth column"
);
$arrData = array(
array("this", "is", "first", "row"),
array("could", "come", "from", "database")
);
$trIDFunction = function($row) {
if ($row[1] == "come") {
return "blue";
} else {
return null;
}
};
$table = new HTMLTable();
$table->setData($arrData);
$table->setHeaders($arrHeaders);
$table->setTrIDFunction($trIDFunction);
echo $table->getHTML();
echo "<style>
#blue{background-color: blue;}
</style>";
|