Click here to Skip to main content
16,013,489 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: How to make the columns of two tables have the same width? Pin
Jeremy Falcon9-Aug-02 5:49
professionalJeremy Falcon9-Aug-02 5:49 
GeneralRe: How to make the columns of two tables have the same width? Pin
Alvaro Mendez9-Aug-02 6:29
Alvaro Mendez9-Aug-02 6:29 
AnswerA solution! Pin
Alvaro Mendez9-Aug-02 9:57
Alvaro Mendez9-Aug-02 9:57 
GeneralCatch enter pressing Pin
Mazdak9-Aug-02 3:24
Mazdak9-Aug-02 3:24 
GeneralRe: Catch enter pressing Pin
Jared Solomon9-Aug-02 10:58
Jared Solomon9-Aug-02 10:58 
GeneralRe: Catch enter pressing Pin
Mazdak9-Aug-02 19:15
Mazdak9-Aug-02 19:15 
GeneralPrint HTMl Pin
Raju Pande MKCL Pune8-Aug-02 23:36
sussRaju Pande MKCL Pune8-Aug-02 23:36 
GeneralRe: Print HTMl Pin
Paul Watson9-Aug-02 0:36
sitebuilderPaul Watson9-Aug-02 0:36 
Raju Pande MKCL Pune wrote:
I don't want to print "button" on paper. i want to print only content on paper.

CSS to the rescue! G'damn I love CSS.

Ok, but this only works on modern browsers so if your print needs to work on IE4 or Netscape 4 or earlier, then this won't work and you will have to create a totally seperate page without a button.

Basically you have two CSS files. One for the screen and one for printing. In your HTML page you code this:
<link rel="stylesheet" type="text/css" media="screen" href="css/screen.css" />
<link rel="stylesheet" type="text/css" media="print" href="css/print.css" />


So there you have reference two style sheets, and the media attribute tells your browser which one to use for which media, screen for on screen and print for printing. You can also specify mobile, braille, handheld etc. etc.

Then in your screen.css file you do this:
input{
    display: block;
    /* and whatever other styles you want your input elements to have */
}


and in your print.css file you do this:
input{
    display: none;
}


That display: none; tells the browser not to show the input element at all, and because it is in your print media CSS file, it won't show up on your printed page.

You can see an example of this at Zeldman's A List Apart site. Look at the page on your screen and then print it. You will see a big difference and that is because he has used print media and a screen media CSS files.

You can of course do this technique to any element on the page you do not want printed. Images, tables, divs etc. etc. You can also re-layout your page to print properly.

Hope that helps.

regards,
Paul Watson
Bluegrass
Cape Town, South Africa
QuestionCompile a String of Email Addresses? Pin
Robby8-Aug-02 11:58
Robby8-Aug-02 11:58 
AnswerRe: Compile a String of Email Addresses? Pin
Bullschmidt8-Aug-02 16:31
Bullschmidt8-Aug-02 16:31 
GeneralRe: Compile a String of Email Addresses? Pin
Robby9-Aug-02 3:15
Robby9-Aug-02 3:15 
QuestionFill out a form dynamically? Pin
JohnnyNin8-Aug-02 11:18
JohnnyNin8-Aug-02 11:18 
AnswerRe: Fill out a form dynamically? Pin
Jared Solomon8-Aug-02 12:18
Jared Solomon8-Aug-02 12:18 
AnswerRe: Fill out a form dynamically? Pin
Todd Smith8-Aug-02 13:16
Todd Smith8-Aug-02 13:16 
AnswerRe: Fill out a form dynamically? Pin
Paul Watson9-Aug-02 0:41
sitebuilderPaul Watson9-Aug-02 0:41 
GeneralASP client-side script debugging with VID,how to?. Pin
Romeo8-Aug-02 7:39
Romeo8-Aug-02 7:39 
GeneralRe: ASP client-side script debugging with VID,how to?. Pin
Jeremy Falcon8-Aug-02 7:40
professionalJeremy Falcon8-Aug-02 7:40 
GeneralCGI & receiving form data from C/C++ Pin
Eepos8-Aug-02 4:40
Eepos8-Aug-02 4:40 
GeneralRe: CGI & receiving form data from C/C++ Pin
Jeremy Falcon8-Aug-02 7:37
professionalJeremy Falcon8-Aug-02 7:37 
GeneralTNX: CGI & receiving form data from C/C++ Pin
Eepos9-Aug-02 0:29
Eepos9-Aug-02 0:29 
GeneralSearch Function Pin
NathanScott7-Aug-02 18:19
NathanScott7-Aug-02 18:19 
GeneralRe: Search Function Pin
Paul Watson8-Aug-02 4:30
sitebuilderPaul Watson8-Aug-02 4:30 
GeneralRe: Search Function Pin
Nick Parker8-Aug-02 7:43
protectorNick Parker8-Aug-02 7:43 
GeneralWebsite syncing tool Pin
benjymous7-Aug-02 0:35
benjymous7-Aug-02 0:35 
GeneralRe: Website syncing tool Pin
Jeremy Falcon7-Aug-02 3:52
professionalJeremy Falcon7-Aug-02 3:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.