Connecting Tech Pros Worldwide Forums | Help | Site Map

3 column structure

pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 407
#1: Aug 29 '08
Hii guys,
I am working to make a 3 column structure say left-column,center content column,right-column.i am able to do it ,but when there is nothing on the left -column the center content column must start from left hand side and take up whole width of left and center and similarly when there is no right-column,the center content column must take up whole width of center and right column,how to achieve this.

Thanks,
Pradeep

Expert
 
Join Date: Aug 2008
Posts: 397
#2: Aug 29 '08

re: 3 column structure


My off-the -wall guess is you need three layouts. A 3-col layout as described, a 2-col layout with a narrow sidebar on the left, and a 2-col layout with a narrow sidebar on the right. Easy enough if it's a static site-- different page for each layout.

If it is an "if situation" where the amount of content, and which layout is appropriate, are unknowns then you're probably after a programming solution rather than CSS solution?
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 407
#3: Sep 4 '08

re: 3 column structure


Quote:

Originally Posted by David Laakso

My off-the -wall guess is you need three layouts. A 3-col layout as described, a 2-col layout with a narrow sidebar on the left, and a 2-col layout with a narrow sidebar on the right. Easy enough if it's a static site-- different page for each layout.

If it is an "if situation" where the amount of content, and which layout is appropriate, are unknowns then you're probably after a programming solution rather than CSS solution?


hey i did the coding for the 3 column layout as u said..its working fine in firefox but not in IE i.e the wisth of content is not getting properly ..plzz can u check my code

This is the 3 column layout i am using http://www.cssplay.co.uk/layouts/3cols.html

and in the html the work around


[PHP] <?php if ($right);else echo "<style type=\"text/css\" media=\"all\">#center {margin-right:0;} #container{border-right:0px;}#inner { margin-right:0px;} *html #center {margin-right:0;} *html #container{border-right:0px;} *html #inner { margin-right:0px;} </style>"; ?>
<?php if ($left);else echo "<style type=\"text/css\" media=\"all\">#center {margin-left:0;} #container{border-left:0px;}#inner { margin-left:0px;} *html #center {margin-left:0;} *html #container{border-left:0px;} *html #inner { margin-left:0px;} </style>"; ?>
<?php if ($right);elseif($left);else echo "<style type=\"text/css\" media=\"all\">#center {margin-left:0;margin-right:0;} #container{border-left:0px;border-right:0px;}#inner { margin-left:0px;margin-right:0px;} *html #center {margin-left:0;margin-right:0;} *html #container{border-left:0px;border-right:0px;} *html #inner { margin-left:0px;margin-right:0px;}</style>"; ?>
[/PHP]
Expert
 
Join Date: Aug 2008
Posts: 397
#4: Sep 4 '08

re: 3 column structure


Insufficient information to resolve the problem. Put your page on a public server and provide a clickable link to it in your post to the forum. Or use this layout layout gala number 14
Reply