codeigniter php 将 table 方向更改为垂直
codeigniter php change table orientation to vertical
如何将 table 方向从水平方向更改为垂直方向?
例子
$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
改成这样:
//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;
如何将 table 方向从水平方向更改为垂直方向?
例子
$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
改成这样:
//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;