You need to float your leftcolumn and also give it a width
Mike Karthauser Brightstorm limited Tel: 07939252144 On 19 Feb 2012, at 18:55, Daniel <[email protected]> wrote: > 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> > <dl> > <dt><?php echo __('Id'); ?></dt> > <dd> > <?php echo h($category['Category']['id']); ?> > > </dd> > <dt><?php echo __('Title'); ?></dt> > <dd> > <?php echo h($category['Category']['title']); ?> > > </dd> > </dl> > </div> > <div class="actions"> > <h3><?php echo __('Actions'); ?></h3> > <ul> > <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> > </ul> > </div> > <div class="related"> > <h3><?php echo __('Related Posts');?></h3> > <?php if (!empty($category['Post'])):?> > <table cellpadding = "0" cellspacing = "0"> > <tr> > <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> > </tr> > <?php > $i = 0; > foreach ($category['Post'] as $post): ?> > <tr> > <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'])); ?> > </td> > </tr> > <?php endforeach; ?> > </table> > <?php endif; ?> > > <div class="actions"> > <ul> > <li><?php echo $this->Html->link(__('New Post'), array('controller' > => 'posts', 'action' => 'add'));?> </li> > </ul> > </div> > </div> > </div> > <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> > <script type="text/javascript" > src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> > </script> > </div> > > Thanks. > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group at > http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
