[eluser]coldKingdom[/eluser]
Hello all you pro's out there!
I'm having a bit of a problem that I've been dealing with today and a result of that I'm on painkillers..no, lets go to the problem
I am doing a picture gallery for users and i have three databases one user table, one for the pictures names and one album table..and the code looks like this
Code:
<?= heading("Bildgalleri", 2); ?>
<hr />
<?php
$tmpl = array('table_open' => '<table cellspacing="0" cellpadding="0" style="float:left;">');
$this->table->set_template($tmpl);
$header = '';
$gallery = '';
foreach ($data["gallery"] as $item):
$img = array(
'src' => '/uploads/pictures/small/'.$item["gallery_picture"],
'alt' => '',
'style' => "margin-right:3px;"
);
$link_attr = array(
'rel' => "shadowbox[".$item[']."]",
'title' => ""
);
if ($header != $item["gallery_album"]) {
$header = $item["gallery_album"];
print heading($item["album_name"], 3);
echo anchor('/uploads/pictures/large/'.$item["gallery_picture"], img($img), $link_attr);
}
else {
echo anchor('/uploads/pictures/large/'.$item["gallery_picture"], img($img), $link_attr);;
}
endforeach;
?>
With this piece of code i wanna to achieve this:
Quote:Album name 1
Picture Picture Picture Picture
Picture Picture Picture Picture
Picture Picture Picture Picture
Album name 2
Picture Picture Picture Picture
Picture Picture Picture Picture
Something like this code wise
Quote:<h3>Album name 1</h3>
<table>
<tr><td>Picture</td><td>Picture</td><td>Picture</td><td>Picture</td></tr>
<tr><td>Picture</td><td>Picture</td><td>Picture</td><td>Picture</td></tr>
<tr><td>Picture</td><td>Picture</td><td>Picture</td><td>Picture</td></tr>
<tr><td>Picture</td><td>Picture</td><td>Picture</td><td>Picture</td></tr>
</table>
<h3>Album name 2</h3>
<table>
<tr><td>Picture</td><td>Picture</td><td>Picture</td><td>Picture</td></tr>
<tr><td>Picture</td><td>Picture</td><td>Picture</td><td>Picture</td></tr>
</table>
It's working right now without tables, now to the question.
How do i bring tables to this code, $this->table->make_columns($gallery, 4) seems great but it breaks every-time i try it. I need some fresh ideas!
I appreciate all help i can get!
Thanks!