Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Tableless 3 column layout - how to make the middle column expand when nothing in right columnTableless 3 column layout - how to make the middle column expand when nothing in right column
Previous
 
Next
New Post
7/28/2008 9:06 AM
 

I have got a working skin with a "pure CSS"/tableless 3 column layout, but now I want the middle column to expand out to the right to fill the space left when there is no content in the right column.

If there is no module in the right column (ID = rightpane), DNN helpfully does not render the rightpane DIV at all. However DIVs do not seem to have the ability to expand into empty space (or at least the way I am using them), so my middle column (ID = contentpane) just sits where it is unchanged.

The technique I am using to create the 3 column layout is to create a DIV for each column, float the left one to the left and the right one to the right. This allows the middle one to "float up" and sit between them. It only works if each DIV has a fixed width, and the middle one is positioned with margins to avoid colision with the others. Here is a snippet of the HTML and CSS:

div id="mainwrapper"

    div id="leftbar"
        snapsis:navmenu id="leftnavmenu" ............ /
        div id="leftpane" runat="server" visible="false"
        /div
    /div
    div id="rightpane" class="rightpane" runat="server" visible="false"
    /div
    div id="contentpane" class="contentpane" runat="server" visible="false"
    /div
/div


#mainwrapper
{
 width: 814px;
 margin: 0 auto 0 auto;
 padding: 0;
 border: 1px solid #a9a397;
 background: #ffffff url( 'img/decoration_line_gray.gif' ) repeat-x bottom left;
 overflow: auto;
}

#leftbar
{
 clear: left;
 float: left;
 width: 180px;
 margin: 0 0 5px;
 padding: 0;
 background: transparent url( 'img/dotted_line.gif' ) repeat-y top right;
}


.contentpane
{
 min-height: 500px;
 margin: 0 0 20px 190px;
 padding: 0;
 color: #181005;
 line-height: 1.175em;
 position: relative;
 width: 455px;
}


.rightpane
{
 width: 130px;
 min-height: 500px;
 padding: 0 10px 0 10px;
 margin: 0;
 float: right;
 background: transparent url( 'img/dotted_line.gif' ) repeat-y top left;
}

Does anyone know of a CSS based technique (rather than JS based)?

Extra question for bonus points! I have noticed that when I put modules in a DIV-based pane, some overflow the edges of the DIV. Text tends to stay within the DIV by wrapping itself, but other content types, particulary tables, overflow. I have discovered the overflow CSS parameter, but there seems to be no option for "expand the container to fit the content". If there is a border or background on the DIV to make it obvious where the edges are it looks really odd for the content to be escaping the container!

 
New Post
7/28/2008 10:14 AM
 

AFAIK, you cannot use a floated div for the center column if you don't set its width. (this does work in some IE versions BTW, but that's NOT correct according to W3C)

This is because its default width is 100%.

Using display:table-cell would be the way to go but you will get some (other) browser problems (meaning IE)

You could use a ASP.NET solution, check if the rightpane has any content and add a class to the page is not, and then set a different CSS width for the contentpane.

Answer to you bonus question: no, AFAIK, there is no way but the display : table-cell

 

 
New Post
7/28/2008 1:14 PM
 

Thanks for the quick reply. I have not come across display:table-cell before - is this standard CSS? If I use it which browsers will have problems?

If all else fails I will try the ASP.NET technique. I don't want to alter the DNN core so maybe I can insert the right server side code inside a <%=    %> tag. I am already using a lot of the tips from this article to access objects on the server: DotNetNuke Tokens: Some tricks for getting more than SkinPath in your skin. 

 
New Post
7/28/2008 3:56 PM
 

Yes it table-cell is CSS standard, but not supported by IE 7 and below IIRC

I would go for ASP.NET, you can add the code to an ascx skin, no reason to edit the core, just like the snapsis examples.

 
New Post
7/30/2008 7:17 PM
 

In the end I used a table to hold the panes - not "pure CSS" but works really well. The right cell holds a fixed width DIV which is the RightPane, and the middle cell is itsself the ContentPane and has width:100%. So, when the RightPane DIV is not rendered the ContentPane cell expands.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Tableless 3 column layout - how to make the middle column expand when nothing in right columnTableless 3 column layout - how to make the middle column expand when nothing in right column


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out