Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change places on parts on webpage

Status
Not open for further replies.

Pichdude

Programmer
Aug 24, 2005
66
SE
Hi,

I have a webpage that presents information in to columns, like this:

| Information1 | Information2 |
| 111 | 222 |
| 111 | 222 |
| 111 | 222 |
| 111 | 222 |

I want to be able present a new window (which will be sort of a print preview) that acctually is the same page, but with the content restructured i rows, preferrable by css, like this:

-----------------------
Information1
111
111
111
-----------------------
Information2
222
222
222


Is that possible, for example by using the div-tag to mark up the different parts and place the divs on different places depending on if it's the original page or the print priview page.

Just to clarify, both the original page and the print priview page will be the same jsp-page.

Best regards!
 
If what you presented is not tabular data (and it looks like it might not be), there's a simple solution to it. For screen, put the information in two lists and float them. For printing, don't float them (or defloat them). You should be ok with that and won't even need another page, since you can control printing stylesheet and screen stylesheet separately.
 
Thanks

How might a css to controll that look?
 
The keyword is media attribute. For the css file with media="screen" you would do something like [tt]ul.someclass { width: 45%; float: left; }[/tt] and for the media="print" you would have [tt]ul.someclass { width: 100%; float: none; }[/tt]. Hard to be more specific without the actual example.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top