3
I am trying to present these items in this way:
However after several attempts the table always remains so:
How should I make the table to get this result?
View
<h2>Apagar evento</h2>
<br>
<table border="1" width "100px" bordercolor="#e2e2e2" style="word-wrap: break-word" cellpadding="10px">
<tr>
<?php
$i=0;
foreach( $showbills as $showbill ):?>
<th colspan="2" scope="col">
<?php echo $this->Form->postLink('Apagar Evento', array('controller'=> 'showbills', 'action'=>'admin_del_event', $showbill['Showbill']['id_showbill']), array('class'=>'event_del', 'title'=>'Apagar Evento'),__('Tem a certeza que quer apagar este Evento?'));?>
</th>
<tr>
<td style="display:inline-block">
<?php echo $showbill['Showbill']['title'];?>
</td>
<td style="display:inline-block">
<?php echo $this->Html->image('showbill/' . $showbill['Showbill']['image'], array('width' => '189px', 'height' => '267px', 'alt' => $showbill['Showbill']['image']));?>
</td>
</tr>
<?php
$i++;
if($i==3){
echo "</tr><tr>";
$i=0;
}
?>
<?php endforeach ?>
</tr>
</table>
Looks like there’s a syntax error here
<?php
 $i=0;
 foreach( $showbills as $showbill ):?>
I think the right thing would be to;
<?php
 $i=0;
 foreach( $showbills as $showbill );?>
– Silvio Andorinha
No, he’s right this way too.
– SunT
I recommend you to do this without table, mainly because it is dynamic data, soon I show an example of how would look html and css to solve your problem
– Erlon Charles