$table->addRow(array("Name","Arrival Time","Departure Time","Amount"),null,"th");
I need rowspan of 2 for Name and colspan of 2 for rest. How to do that? use setCellAttributes()?
<?php
require_once("HTML/Table.php");
$attr = array("style" => "border:1px solid black;text-align:center;width:500px;height:100px;","align" => "center","border"=>1,"cellspacing"=>"0","cellpadding"=>"5");
$table = new HTML_Table($attr);
$table->addRow(array("Name", "Arrival Time","","Departure Time","", "Amount"),null, "th");
$table->addRow(array("", "AM","PM","AM","PM","Rupees","Paisa"), null,"th");
$table->setCellAttributes(0,0,"rowspan='2'");
for($i=1;$i<=5;$i++){
$table->setCellAttributes(0,$i,"colspan='2'");
}
$table->addRow(array("Toyota","4","","","6","80","50"),null);
$table->addRow(array("Toyota","","8","2","","180","30"),null);
echo $table->toHTML();
?>
You need to use setCellAttributes() function and specify the cell number
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With