codeigniter php将表格方向更改为垂直


codeigniter php change table orientation to vertical

如何将表格方向从水平更改为垂直?

示例

$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;