473,402 Members | 2,055 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,402 software developers and data experts.

Implementing two columns via CSS?

Let me begin by warning you all that I don't have sufficient background in
CSS to state my question with the correct formal terminology so I'll just
use plain English.

Basically, I want to create two columns in my web pages, one for an index
and one for everything else, and I want the pages to print correctly when
the user clicks on the Print button. (I'm not sure if it is correct to say
that I am trying to "float" a box since I'm not quite sure what that means.)

Now, the same information in more detail :-) I want my page to have an index
column occupying roughly 12 to 15% of the width of the page (screen page and
printed page) and I want that index to be on the left hand side of the page.
The index may be longer/taller than the rest of the content on the page, in
fact that will often be the case. The rest of the page will have paragraphs,
images, and the occasional list or table (or both).

At the moment, my pages look fine on the screen - at least when the browser
is using the full screen! - but when I use Print Preview (or Print) the page
splits so that the top of the page has the index on the left with the rest
of the width of the page blank, then the bottom of the page has all of the
content that isn't in the index on the right, starting an index width from
the left. Here's a link so you can see for yourself:
http://sfl.london.on.ca.

Obviously, I'm doing something wrong in either the HTML, the CSS or both.
But I'm not sure how to diagnose the problem, let alone fix it.

If anyone can offer a few conceptual points explaining the essence of the
mistake(s) I've made and can point me to a tutorial explaining the correct
way of handling this situation, I would be very grateful. Even a link to the
tutorial alone would be great, if it's the kind of tutorial or reference
that is organized so that you can look for a result you want in an index and
then go to instructions that show you how to accomplish that.

--
Rhino
Nov 23 '05 #1
10 1602
Els
Rhino wrote:
Let me begin by warning you all that I don't have sufficient background in
CSS to state my question with the correct formal terminology so I'll just
use plain English.
That'll do ;-)
Basically, I want to create two columns in my web pages, one for an index
and one for everything else, and I want the pages to print correctly when
the user clicks on the Print button. (I'm not sure if it is correct to say
that I am trying to "float" a box since I'm not quite sure what that means.)
It's not floated. You just put it left on the page, and positioned the
content absolute, where as if you had floated the navigation, there
would be no need for the absolute positioning of the content.
Now, the same information in more detail :-) I want my page to have an index
column occupying roughly 12 to 15% of the width of the page (screen page and
printed page) and I want that index to be on the left hand side of the page.
The index may be longer/taller than the rest of the content on the page, in
fact that will often be the case. The rest of the page will have paragraphs,
images, and the occasional list or table (or both).

At the moment, my pages look fine on the screen - at least when the browser
is using the full screen! - but when I use Print Preview (or Print) the page
splits so that the top of the page has the index on the left with the rest
of the width of the page blank, then the bottom of the page has all of the
content that isn't in the index on the right, starting an index width from
the left. Here's a link so you can see for yourself:
http://sfl.london.on.ca.


You have two stylesheets, one for screen, and one for print. But in
the stylesheet for print, you didn't use all the styles needed for the
positioning. I copied your code locally, and when I replace
media="screen" with media="print", the print stylesheet "works". That
is, it shows the content to the right of the navigation. It's not
exactly readable in black on blue background, I think that for the
print stylesheet, you should make sure it's black on white only, both
for readability and for people's stock of blue ink ;-)

What I think you missed, is that the stylesheet with media="screen",
isn't used when you're printing the page. If you want it to be used,
use media="all" or leave it out altogether.

Also, after your linked stylesheets, you defined the background colour
thus:
<style type="text/css">#homepage {background: #FF9933}</style>
This is picked up for screen, but also for print.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Nov 23 '05 #2
"Rhino" <no***********************@nospam.com> writes:
Basically, I want to create two columns in my web pages, one for an index
and one for everything else, and I want the pages to print correctly
Els offered a good solution to fixing the problem.

But I'm wondering, since clickable links aren't clickable on paper, is
printing the navigation column correct to begin with? It serves a valuable
purpose on screen, but what purpose does it serve on paper?

Once you sort out the mechanics of using separate stylesheets for screen and
print, you might want to seriously consider using "display=none" for the
navigation div in the print stylesheet.
when the user clicks on the Print button.


But you want it to print incorrectly, or not at all, when they select "File/
Print" instead of clicking the toolbar button? What an odd requirement.

Yes - I'm joking. ;-)

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
Nov 23 '05 #3

"Sherm Pendley" <sh***@dot-app.org> wrote in message
news:m2************@Sherm-Pendleys-Computer.local...
"Rhino" <no***********************@nospam.com> writes:
Basically, I want to create two columns in my web pages, one for an index
and one for everything else, and I want the pages to print correctly


Els offered a good solution to fixing the problem.

But I'm wondering, since clickable links aren't clickable on paper, is
printing the navigation column correct to begin with? It serves a valuable
purpose on screen, but what purpose does it serve on paper?

Once you sort out the mechanics of using separate stylesheets for screen
and
print, you might want to seriously consider using "display=none" for the
navigation div in the print stylesheet.

I had planned to do that :-)

In fact, I had _already_ done it but I failed to adjust the print CSS after
the changes to the HTML which I made yesterday. I've now updated the print
CSS; it's not quite right yet because I want to move the page content over
to occupy the space formerly occupied by the menu but I'll get to that soon.

Aside from that, the pages look fine in Opera and IE6 in screen mode *and*
in Print Preview. However, in Firefox, the index is not disappearing when I
use Print Preview. Any ideas why the index won't disappear?

when the user clicks on the Print button.


But you want it to print incorrectly, or not at all, when they select
"File/
Print" instead of clicking the toolbar button? What an odd requirement.

Yes - I'm joking. ;-)

Sorry for my awkward wording :-)

Nov 23 '05 #4

"Els" <el*********@tiscali.nl> wrote in message
news:p4***************@locusmeus.com...
Rhino wrote:
Let me begin by warning you all that I don't have sufficient background
in
CSS to state my question with the correct formal terminology so I'll just
use plain English.
That'll do ;-)
Basically, I want to create two columns in my web pages, one for an index
and one for everything else, and I want the pages to print correctly when
the user clicks on the Print button. (I'm not sure if it is correct to
say
that I am trying to "float" a box since I'm not quite sure what that
means.)


It's not floated. You just put it left on the page, and positioned the
content absolute, where as if you had floated the navigation, there
would be no need for the absolute positioning of the content.

So, are you saying that the problem is that I didn't float when I should
have? I really don't know; I've heard that absolute positioning is Bad but I
don't know if that means it's bad in every situation or just some
situations; if it's sometimes okay, is it okay in this situation?
Now, the same information in more detail :-) I want my page to have an
index
column occupying roughly 12 to 15% of the width of the page (screen page
and
printed page) and I want that index to be on the left hand side of the
page.
The index may be longer/taller than the rest of the content on the page,
in
fact that will often be the case. The rest of the page will have
paragraphs,
images, and the occasional list or table (or both).

At the moment, my pages look fine on the screen - at least when the
browser
is using the full screen! - but when I use Print Preview (or Print) the
page
splits so that the top of the page has the index on the left with the
rest
of the width of the page blank, then the bottom of the page has all of
the
content that isn't in the index on the right, starting an index width
from
the left. Here's a link so you can see for yourself:
http://sfl.london.on.ca.


You have two stylesheets, one for screen, and one for print. But in
the stylesheet for print, you didn't use all the styles needed for the
positioning. I copied your code locally, and when I replace
media="screen" with media="print", the print stylesheet "works". That
is, it shows the content to the right of the navigation. It's not
exactly readable in black on blue background, I think that for the
print stylesheet, you should make sure it's black on white only, both
for readability and for people's stock of blue ink ;-)

As I said in my reply to Sherm Pendley, I made some changes in the screen
CSS that I forgot to echo in the print CSS; I've now corrected that
situation. It works okay now in IE6 and Opera - the menu and all
"decorative" images are suppressed - and the text is (mostly) black on
white. But the menu hasn't disappeared in Firefox, which has me
wondering....
What I think you missed, is that the stylesheet with media="screen",
isn't used when you're printing the page. If you want it to be used,
use media="all" or leave it out altogether.

Also, after your linked stylesheets, you defined the background colour
thus:
<style type="text/css">#homepage {background: #FF9933}</style>
This is picked up for screen, but also for print.

That was a technique to get the currently-selected page's link to stay
highlighted in the index as long as that page was selected. I hadn't planned
for that technique to affect the printing and, now that I've suppressed the
printing of the menu, it doesn't any more :-)

Rhino

Nov 23 '05 #5
Els
Rhino wrote:
"Els" <el*********@tiscali.nl> wrote in message
news:p4***************@locusmeus.com...
Rhino wrote:
Basically, I want to create two columns in my web pages, one for
an index and one for everything else, and I want the pages to
print correctly when the user clicks on the Print button. (I'm
not sure if it is correct to say that I am trying to "float" a
box since I'm not quite sure what that means.)
It's not floated. You just put it left on the page, and positioned the
content absolute, where as if you had floated the navigation, there
would be no need for the absolute positioning of the content.

So, are you saying that the problem is that I didn't float when I should
have?


No, I just explained the difference between floating and what you did.
Not saying it's bad or good or anything.
I really don't know; I've heard that absolute positioning is Bad but I
don't know if that means it's bad in every situation or just some
situations; if it's sometimes okay, is it okay in this situation?
It's bad when you don't understand why it could be bad ;-)
As I said in my reply to Sherm Pendley, I made some changes in the
screen CSS that I forgot to echo in the print CSS; I've now
corrected that situation. It works okay now in IE6 and Opera - the
menu and all "decorative" images are suppressed - and the text is
(mostly) black on white. But the menu hasn't disappeared in
Firefox, which has me wondering....


Not in my Firefox. Menu is gone in print preview.
One problem I do see though, is that in Opera, the print preview shows
black on dark blue still. It's black on white in Firefox and IE.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Nov 23 '05 #6
Stuart Scharf wrote:
Attached is what I get when I go full width on my browser. The columns
overlap.


Please do *not* post binary attachments in text-only newsgroups.

Further, it would be nice if you had stated what browser and version you
are using, because I do not see what you see in my browsers.
Firefox 1.0.7, Opera 8.5, IE6, K-Meleon 0.8.2 all show the page as
expected.

--
-bts
-Warning: I brake for lawn deer
Nov 23 '05 #7
Beauregard T. Shagnasty wrote:
Stuart Scharf wrote:

Attached is what I get when I go full width on my browser. The columns
overlap.

Please do *not* post binary attachments in text-only newsgroups.

Further, it would be nice if you had stated what browser and version you
are using, because I do not see what you see in my browsers.
Firefox 1.0.7, Opera 8.5, IE6, K-Meleon 0.8.2 all show the page as
expected.


Sorry, I didn't realize the "no binary attachment" restriction for this
group. (Other groups prefer that a picture is worth 1k words)

The browser is firefox 1.0.7 (on the Apple 2560 X 1600 display)

Stuart
Nov 23 '05 #8
On Mon, 21 Nov 2005 21:18:24 +0100, Stuart Scharf <no****@ll.mit.edu>
wrote:
Beauregard T. Shagnasty wrote:
Stuart Scharf wrote:
Attached is what I get when I go full width on my browser. The columns
overlap.


Please do *not* post binary attachments in text-only newsgroups.

Sorry, I didn't realize the "no binary attachment" restriction for this
group. (Other groups prefer that a picture is worth 1k words)


Which is true here also. But, not sent with the message. Upload it to your
host a a free account somewhere and post an URL to it. Everybody happy.

--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
Nov 23 '05 #9
Stuart Scharf wrote:
Beauregard T. Shagnasty wrote:
Stuart Scharf wrote:
Attached is what I get when I go full width on my browser. The
columns overlap.
Please do *not* post binary attachments in text-only newsgroups.

Further, it would be nice if you had stated what browser and version
you are using, because I do not see what you see in my browsers.
Firefox 1.0.7, Opera 8.5, IE6, K-Meleon 0.8.2 all show the page as
expected.


Sorry, I didn't realize the "no binary attachment" restriction for
this group. (Other groups prefer that a picture is worth 1k words)


Binaries should only be posted to groups with ".binaries." in their
name.
The browser is firefox 1.0.7 (on the Apple 2560 X 1600 display)


Then this must be something peculier to the Mac/Apple, or the Mac
version of Firefox. Since I don't have a Mac ...

--
-bts
-Warning: I brake for lawn deer
Nov 23 '05 #10
Beauregard T. Shagnasty wrote:
Stuart Scharf wrote:

Beauregard T. Shagnasty wrote:
Stuart Scharf wrote:
Attached is what I get when I go full width on my browser. The
columns overlap.

Please do *not* post binary attachments in text-only newsgroups.

Further, it would be nice if you had stated what browser and version
you are using, because I do not see what you see in my browsers.
Firefox 1.0.7, Opera 8.5, IE6, K-Meleon 0.8.2 all show the page as
expected.


Sorry, I didn't realize the "no binary attachment" restriction for
this group. (Other groups prefer that a picture is worth 1k words)

Binaries should only be posted to groups with ".binaries." in their
name.

The browser is firefox 1.0.7 (on the Apple 2560 X 1600 display)

Then this must be something peculier to the Mac/Apple, or the Mac
version of Firefox. Since I don't have a Mac ...


No, the display is an Apple, the Computer a Dell, the OS Debian Testing,
The Firefox from the Debian distribution

Stuart
Nov 23 '05 #11

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

Similar topics

15
by: Agoston Bejo | last post by:
Hi, I'm having trouble with implementing some constraints on the database level. An example: --Table A(AID, BID ref. B.BID, ATXT) --Table B(BID, CID ref. C.CID) --Table C(CID) upon insertion...
4
by: David | last post by:
I am creating a web community site where each user can have a list of buddies. I have struck a bit of a problem though. I am designing my db model and have two entities called users containing...
0
by: Alx Sharp | last post by:
Hello group! I got a little question for you all... I've created two classes (FirstCollection and SecondCollection) that implements some interfaces: IBindingList, IList, ICollection,...
6
by: Kerry Sanders | last post by:
I am working on a project for work where I need a specialized type converter to convert the value of a string which is edited in a grid back to the underlying object type from the cell. The value...
6
by: WebMatrix | last post by:
Hello, Sorry for the repost, I haven’t got any response in aspnet.webservices group. We have a web service being used by several clients. It's SSL secured, uses Windows (Basic)...
6
by: Index | last post by:
Hi, I have a file which I want to sort depending on multiple columns. Actually I want to implement the following query through programming: SELECT SUM(VALUES) GROUP BY x,y ORDER BY x,y; the...
4
by: phl | last post by:
hi, My question is: 1. To avoid possible memory leaks, when you use this pattern, after you have dealth with the unmanaged resources and before you take your object off the finalize queue,...
5
ck9663
by: ck9663 | last post by:
question.... i have a table with around 130 columns x (smallest, 20K, biggest 15M) rows. i need to check around 15 of those columns. if one or more columns is "doubtful" based on some business...
2
by: ssubbarayan | last post by:
Dear all, I am in the process of implementing pageup/pagedown feature in our consumer electronics project.The idea is to provide feature to the customers to that similar to viewing a single sms...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.