Hello I'd like to ask for help in regards to displaying the following query in 3 columns. I think I need to read up on arrays, because I can't seem to get anything working.. Is it doable with this code of mine, or would I need to rewrite this before getting my desired result?
<?php foreach ($this->items as $item) :?>
<?php if($item->state == 1 || ($item->state == 0 && JFactory::getUser()->authorise('core.edit.own',' com_bryllup'))):$show = true;?>
<input type="checkbox" name="<?php echo $item->felt_titel; ?>" value="<?php echo $item->felt_titel; ?>">
<h3><?php echo $item->felt_titel; ?></h3>
<p><?php echo $iyem->felt_beskrivelse; ?></p>
<?php endif; ?>
What I would like to achieve is something like this:
-Result1------Result2------Result3-
-Result4------Result5------Result6-
-etc-----------etc-----------etc---
Well since you've added a diagram of what you like then it's even easier. You can do it with your existing loop
CSS
// set width to a third of the width of the containing div
div.result {
width:250px;
height:300px;
float:left;
}
HTML
<?php foreach ($this->items as $item) :?>
<?php if($item->state == 1 || ($item->state == 0 && JFactory::getUser()->authorise('core.edit.own',' com_bryllup'))):$show = true;?>
<input type="checkbox" name="<?php echo $item->felt_titel; ?>" value="<?php echo $item->felt_titel; ?>">
<div class="result">
<h3><?php echo $item->felt_titel; ?></h3>
<p><?php echo $iyem->felt_beskrivelse; ?></p>
</div>
<?php endif; ?>