2017-11-23 1 views
0

생성 된 테이블의 왼쪽에 추가 열을 추가하려면 어떻게합니까? 나는 그것을 어떻게하는지 전혀 모른다. 미리 감사드립니다. Codeigniter : 기본 생성 테이블에 추가 열 추가

(내 코드의 조각)

$this->load->library('table'); 
     $this->table->set_caption($campagne); 
     $this->table->set_heading('Campagne','Datum','Eindecode', 'Totaal',  '09:00', '09:30', '10:00', '10:30', '11:00', '11:30', '12:00', '12:30', '13:00', '13:30', '12:00', '12:30', '13:00', '13:30', '14:00', '14:30', '15:00', '15:30', '16:00', '16:30', '17:00', '17:30', '18:00', '18:30', '19:00', '19:30'); 
$template = array(
     'table_open'   => '<table border="1" cellpadding="4" cellspacing="0">', 

     'thead_open'   => '<thead>', 
     'thead_close'   => '</thead>', 

     'heading_row_start'  => '<tr>', 
     'heading_row_end'  => '</tr>', 
     'heading_cell_start' => '<th>', 
     'heading_cell_end'  => '</th>', 

     'tbody_open'   => '<tbody>', 
     'tbody_close'   => '</tbody>', 

     'row_start'    => '<tr>', 
     'row_end'    => '</tr>', 
     'cell_start'   => '<td>', 
     'cell_end'    => '</td>', 

     'row_alt_start'   => '<tr>', 
     'row_alt_end'   => '</tr>', 
     'cell_alt_start'  => '<td>', 
     'cell_alt_end'   => '</td>', 

     'table_close'   => '</table>' 
      ); 

    $this->table->set_template($template);  
    return $this->table->generate($query1); 

미안 해요, 난 때문에

+0

이 스크립트 결과의 스크린 샷을 제공해 주시겠습니까? – TripleDeal

답변

0

나는 당신이에 새 열을 추가 할 수 있다고 생각 민감한 정보의 모든 것을 표시 할 수 없습니다 $ query1의 모든 행에있는 첫 번째 요소를 포함하여 왼쪽에 있습니다. 예 :

for($i = 0; $i < count($query1); $i++){ 
    array_unshift($query1[$i], $element); 
}  
return $this->table->generate($query1); 

여기서 $ element는 각각 원하는 경우가되어야합니다. 당신을 도울 수 있기를 희망합니다! 감사합니다. .

+0

메시지 : 구문 오류, 예기치 않은 ';' – Faruk

+0

죄송합니다 $ for for for ...을 (를) 삭제했습니다. – jlosada

관련 문제