I have problem in my view display in codeigniter
I have a problem with my database display in the 'view' in CodeIgniter, I've been able to do load my database and display data using tables, but the data is performed by using extends vertically downwards by using a row, whereas I want to display it horizontally by using column
[my view display in browser]
[data 1]
[data 2]
[data 3]
[etc...]
my view I wanted!
[data 1] [data 2] [data 3] [etc..]
this is my Controller Code:
function coba(){
// nyobain nge load td secara multiple
$data['query'] = $this->Latihan_model->coba()->result();
$this->load->view('rubbish/coba',$data);
}
this is my model Code:
function coba(){
$sql = ("
SELECT soal.ID_soal as soal
from soal
where soal.ID_bagian = 1;
"); return $this->db->query($sql);
}
this is my view code:
<table border=1>
<?php foreach($query as $post): ?>
<tr>
<td><? echo $post->soal; ?></td>
</tr>
<?php endforeach; ?>
I hope you're understand what I am asked
troutside foreach?