如何将表格方向从水平更改为垂直?
例如
$this->table->set_heading('Name', 'Surname');
$tabClient = $this->table->generate($client);
echo $tabClient;
提供
Name Surname
Mark Mark
Greg Greg
可以改为:
Name Mark Greg
Surname Mark Greg
答案 0 :(得分:1)
像这样改变:
//assuming your clients array is in this structure
$clients = array(
array("John", "Doe"),
array("Jane", "Smith"),
);
$this->load->library('table');
$fnames[] = "<strong>Name</strong>";
$lnames[] = "<strong>Surname</strong>";
foreach ($clients as $client) {
$fnames[] = $client[0];
$lnames[] = $client[1];
}
$this->load->library('table');
$this->table->add_row($fnames);
$this->table->add_row($lnames);
$tabClient = $this->table->generate();
echo $tabClient;