Solved

html code fit when print

Posted on 2007-12-07
2
2,195 Views
Last Modified: 2010-08-05
if i use  <table width="100%"> it will fit exactly on any paper size. or I need to use with in centiment then it will fit to a4 paper
0
Comment
Question by:teera
2 Comments
 
LVL 16

Accepted Solution

by:
rbudj earned 250 total points
ID: 20427520
It depends on any set width elements you have on your page.  For example, if you have an image with a with a width of 780px then you should be ok, however, it you have an image, or a fixed width <td> larger than 780px then you are taking a chance on having some of it cut off when printing.  I have found that 780px is the maximum fixed width of any element on your page to make your page printer friendly. The best way to test is to open the page in a browser and go to File > print prevew
0
 
LVL 3

Assisted Solution

by:ERNesbitt
ERNesbitt earned 250 total points
ID: 20427571
You could use a style sheet for display and another for printing using the "media" property:

<style type="text/css" media="screen">@import "web.css";</style>
<style type="text/css" media="print">@import "print.css";</style>

Then, set your widths for your table inside the style sheets and give the table an id or a class.

web.css
#content { width:100%; }

print.css
#content { width: 19cm; }

page.html
<table id="content">
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Why is this panel heading creating extra space 2 36
Apply tab index in forms 6 33
html5 auto send email 7 22
HTML Relative path 9 29
This article discusses four methods for overlaying images in a container on a web page
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now