Solved

html code fit when print

Posted on 2007-12-07
2
2,194 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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

763 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

5 Experts available now in Live!

Get 1:1 Help Now