0
我使用codeigniter來幫助我從mySQL數據庫創建表,但set_template()將爲我創建兩個thead標籤。我不知道爲什麼會發生這種情況。這裏是我得到了什麼之後笨創建表:Codeigniter set_template()創建兩個thead標籤
<table id = "guestList" style="border-collapse: collapse; width: 100%;">
<thead>
<thead style="background: #E3EBEE; font-size: 15px;color: #1C75BC;">
<th style="padding: 10px;">Order#</th>
<th style="padding: 10px;">Qty</th>
<th style="padding: 10px;">Customer</th>
<th style="padding: 10px;">Order Date</th>
<th style="padding: 10px;">Ticket Type</th>
<th style="padding: 10px;">Price</th>
<th style="padding: 10px;">Delivery Method</th>
<th style="padding: 10px;">Option</th>
</thead>
</thead>
這是創建表的代碼:
<?php
$tmpl = array (
'table_open' => '<table id = "guestList" style="border-collapse: collapse; width: 100%;">',
'heading_row_start' => '<thead style="background: #E3EBEE; font-size: 15px;color: #1C75BC;">',
'heading_row_end' => '</thead>',
'heading_cell_start' => '<th style="padding: 10px;">',
'heading_cell_end' => '</th>',
'row_start' => '<tr>',
'row_end' => '</tr>',
'cell_start' => '<td style="padding: 10px;">',
'cell_end' => '</td>',
'row_alt_start' => '<tr>',
'row_alt_end' => '</tr>',
'cell_alt_start' => '<td style="padding: 10px;">',
'cell_alt_end' => '</td>',
'table_close' => '</table>'
);
$this->table->set_template($tmpl);
$this->table->set_heading('Order#', 'Qty' , 'Customer', 'Order Date', 'Ticket Type', 'Price', 'Delivery Method');
echo $this->table->generate($record);
?>
Heading_row_start必須是