473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Optional column?

I have a three-column layout. On the left is always the navigation.
Right of that is the wider bit, containing the main text. Next to
the main text, in the right margin, I might have a sidebar.

The key word there is *might*. I'd like to have it so that the main
text expands to fill the entire content width when there's no side
bar, but I haven't been able to arrange it so it works. Does anyone
have an example of making it work?
--
Helge Moulding
mailto:hmoulding at google dot com Just another guy
http://hmoulding.cjb.net/ with a weird name

Oct 2 '05 #1
6 1787
Helge Moulding wrote:
I have a three-column layout. On the left is always the navigation.
Right of that is the wider bit, containing the main text. Next to
the main text, in the right margin, I might have a sidebar.

The key word there is *might*. I'd like to have it so that the main
text expands to fill the entire content width when there's no side
bar, but I haven't been able to arrange it so it works. Does anyone
have an example of making it work?


The answer would depend upon how you have your columns defined. CSS?
Tables? Frames?

URL please.

--
-bts
-When motorcycling, never follow a pig truck
Oct 2 '05 #2
Beauregard T. Shagnasty wrote:
The answer would depend upon how you have your columns defined. CSS?
Tables? Frames?


This is the stylesheets froup, right? I was actually hoping for
an example of a site that made it work, but here is what I'm
currently working on:
http://xmission.com/~helgem/test/

What I want is to be able to say

<div id="wrapper">
<div id="nav">
stuff
</div>
<div id="main">
stuff
</div>
<div id="sidebar">
stuff
</div>
</div>

or just

<div id="wrapper">
<div id="nav">
stuff
</div>
<div id="main">
stuff
</div>
</div>

and have the first bit render as two columns, side by side,
while the second bit renders as a single column that takes
up the entire area that ordinarily would be taken up by both
the main bit and the sidebar. (My stylesheet has a print
version that puts the sidebar below the main text and skips
the nav area entirely.)

As you can see, the site is a tad more complex than what I've
shown here. There are a couple more divs that take care of
setting up a semi-flexible min-max width of the page (part of
that is a hack to make it work in IE as well as in Firefox)
and centering it. And there's a header. But the meat of the
question is how to make the sidebar optional. I like white
space well enough, but there's such a thing as being wasteful. :-)
--
Helge Moulding
hmoulding at gmail dot com Just another guy
http://hmoulding.cjb.net/ with a weird name

Oct 3 '05 #3
Helge Moulding wrote:
Beauregard T. Shagnasty wrote:
The answer would depend upon how you have your columns defined. CSS?
Tables? Frames?


This is the stylesheets froup, right? I was actually hoping for
an example of a site that made it work, but here is what I'm
currently working on:
http://xmission.com/~helgem/test/


If you have no sidebar div in a page, and:
#content { width: 52%;
is standard, try adding:
#content { width: 80%; }
into a <style> in the head, after the call to the stylesheet.

--
-bts
-When motorcycling, never follow a pig truck
Oct 3 '05 #4
Beauregard T. Shagnasty wrote:
If you have no sidebar div in a page, and:
#content { width: 52%;
is standard, try adding:
#content { width: 80%; }
into a <style> in the head, after the call to the stylesheet.


That's what I don't want to do. I want my content column to take
up the space reserved for the side bar when there is no sidebar,
but without having to add different markup for pages that have a
sidebar versus pages that don't have a sidebar.
--
Helge Moulding
hmoulding at gmail dot com Just another guy
http://hmoulding.cjb.net/ with a weird name

Oct 3 '05 #5
Helge Moulding wrote:
Beauregard T. Shagnasty wrote:
If you have no sidebar div in a page, and:
#content { width: 52%;
is standard, try adding:
#content { width: 80%; }
into a <style> in the head, after the call to the stylesheet.


That's what I don't want to do. I want my content column to take
up the space reserved for the side bar when there is no sidebar,
but without having to add different markup for pages that have a
sidebar versus pages that don't have a sidebar.


Well, then I can't see any other way. You have to modify the page
(template?) to remove the sidebar div, so what is the reason you can't
(or don't want to) add a style line in the <head>?

I do this on several pages (two-column: menu and content) where I want
to remove the menu. A simple <style></style> line resetting the content
div's margin works great.

--
-bts
-When motorcycling, never follow a pig truck
Oct 3 '05 #6
Beauregard T. Shagnasty wrote:
Well, then I can't see any other way.


Dang. Thanks for your advice, though.
--
Helge Moulding
hmoulding at gmail dot com Just another guy
http://hmoulding.cjb.net/ with a weird name

Oct 4 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Özden Irmak | last post by:
Hi, In my C# applicaiton, I use ADOX to reach and check the user permissions in my Access database. To do this, there is a function named "GetPermissions". This function gets 3 arguments where...
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
1
by: Tookelso | last post by:
Hello, I would like to have a group of elements which are *required* in one context, but each one is *optional* in another context. For example: I have a configuration file which has a...
12
by: pamelafluente | last post by:
Hi guys, In the past I have used several time optional parameters in my function. But Now I am more inclined to think that they are more dangerous than useful, and probably better to be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.