Hi all Iam trying to build a website that has a ‘div container’ and within this div three main columns, ‘div left’, ‘div middle’ and ‘div right’.
I have tried to set the width for each column to 25%, 50%, and 25% respectively – also floated all divs left – with two images either side of the table (div middle). Unfortunately the three divs are on separate lines instead of side by side. Has anyone got any tips or advice for this? Any help would be appreciated.
Note: The middle div (holding the table) is populated as events are added.
<div id = "container" style = "width:100%">
<div id ="left" style = "float: left; width: 25%;">
<?php echo $this->Html->image('/img/sideart.jpg'); ?>
</div>
<div id = "middle" style = "float: center; width: 50%; height: 100%;">
<table cellpadding="0" cellspacing="0">
<tr>
</tr>
<?php
foreach ($events as $event): ?>
<tr>
<td class="actions">
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div id = "right" style = "float:right; width: 25%;">
<?php echo $this->Html->image('/img/sideart2.jpg'); ?>
</div>
</div>
There is no such thing as float:center. By floating them all left they will line up next to each other.