Message info
To:CakePHP From:Daniel Subject:CSS column problem Date:Sun, 19 Feb 2012 10:55:54 -0800 (PST)

OK, it's not really a Cake problem, but I get this problem when trying
to put a column on the right hand side of a Cake page. I have two new
divs, one for the left column and one for the right column. The
problem is that the right column appears below and to the right of the
left column (e.g. diagonal) , whereas I want it to appear just to the
right of the left column.

Here is my CSS code
#leftnav {
margin-right: 170px;
padding: 5px;

#rightnav {
float: right;
width: 170px;
margin-left: -170px;
padding: 5px;

... and here is my ctp view file:
<div id="leftnav">
<div class="categories view">
<h2><?php echo __('Category');?></h2>
<dt><?php echo __('Id'); ?></dt>
<?php echo h($category['Category']['id']); ?>
<dt><?php echo __('Title'); ?></dt>
<?php echo h($category['Category']['title']); ?>
<div class="actions">
<h3><?php echo __('Actions'); ?></h3>
<li><?php echo $this->Html->link(__('Edit Category'), array('action'
=> 'edit', $category['Category']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Category'),
array('action' => 'delete', $category['Category']['id']), null,
__('Are you sure you want to delete # %s?', $category['Category']
['id'])); ?> </li>
<li><?php echo $this->Html->link(__('List Categories'),
array('action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Category'), array('action'
=> 'add')); ?> </li>
<li><?php echo $this->Html->link(__('List Posts'),
array('controller' => 'posts', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Post'), array('controller'
=> 'posts', 'action' => 'add')); ?> </li>
<div class="related">
<h3><?php echo __('Related Posts');?></h3>
<?php if (!empty($category['Post'])):?>
<table cellpadding = "0" cellspacing = "0">
<th><?php echo __('Id'); ?></th>
<th><?php echo __('Category Id'); ?></th>
<th><?php echo __('Title'); ?></th>
<th><?php echo __('User Id'); ?></th>
<th><?php echo __('Modified'); ?></th>
<th><?php echo __('Created'); ?></th>
<th class="actions"><?php echo __('Actions');?></th>
$i = 0;
foreach ($category['Post'] as $post): ?>
<td><?php echo $post['id'];?></td>
<td><?php echo $post['category_id'];?></td>
<td><?php echo $post['title'];?></td>
<td><?php echo $post['user_id'];?></td>
<td><?php echo $post['modified'];?></td>
<td><?php echo $post['created'];?></td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('controller' =>
'posts', 'action' => 'view', $post['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('controller' =>
'posts', 'action' => 'edit', $post['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('controller'
=> 'posts', 'action' => 'delete', $post['id']), null, __('Are you sure
you want to delete # %s?', $post['id'])); ?>
<?php endforeach; ?>
<?php endif; ?>

<div class="actions">
<li><?php echo $this->Html->link(__('New Post'), array('controller'
=> 'posts', 'action' => 'add'));?> </li>
<div id="rightnav">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-8349731408636005";
/* Skyscraper ad 1 */
google_ad_slot = "2026094649";
google_ad_width = 160;
google_ad_height = 600;
<script type="text/javascript"


Our newest site for the community: CakePHP Video Tutorials
Check out the new CakePHP Questions site and help others with their CakePHP related questions.

To unsubscribe from this group, send email to For more options, visit this group at