Page 1 of 1

table too long to print

Posted: Tue Aug 16, 2005 7:17 am
by gurjit
I have a table which is "1700px"

I want to print this table in "landscape" and when it comes to the end of the page print the rest on another sheet.

How can i do this?

At the moment the page only prints as much as it can on a page.

In the example below it will only print to "row 6" and leave the rest. I want "row 7" onwards on the next page.

Code: Select all

<table  border="0" width="1700" cellspacing="0" cellpadding="0">
<tr>
<td>row 1</td>
<td>row 2</td>
<td>row 3</td>
<td>row 4</td>
<td>row 5</td>
<td>row 6</td>
<td>row 7</td>
<td>row 8</td>
<td>row 9</td>
<td>row 10</td>
<tr>
<tr>
<td>row 1</td>
<td>row 2</td>
<td>row 3</td>
<td>row 4</td>
<td>row 5</td>
<td>row 6</td>
<td>row 7</td>
<td>row 8</td>
<td>row 9</td>
<td>row 10</td>
<tr>
</table>

Posted: Tue Aug 16, 2005 7:53 am
by feyd
sounds like it's working as you want it... :?

Posted: Tue Aug 16, 2005 8:50 am
by John Cartwright
Moved to client-side.

Posted: Tue Aug 16, 2005 9:11 am
by CoderGoblin
You could imbed some CSS into your code...

Code: Select all

<style>
@media print { tr.pagebreak {page-break-before: always}}
</style>
and in your main table

Code: Select all

<tr class="pagebreak"><td>xxxxxx</td><td>lkjlkjl</td></tr>
This should work if you know how many rows per page you will need (I believe, haven't ever tested).

Another alternative is to convert the HTML into another format for printing (e.g.PDF) and print that.

Posted: Tue Aug 16, 2005 10:08 am
by wwwapu
I wasn't quite sure what you wanted, but here is one suggestion

Code: Select all

table{
	width: 1700px;
}

@media print{
	body{
		margin: 0;
	}
	table{
		width: 255mm;
	}
	td{
		width: 25.5mm;
	}
}
print width estimated 255 because I have 19,05 pagemargins in IE

Posted: Tue Aug 16, 2005 11:37 am
by gurjit
Is there anyway I can break the <td>

for example

Code: Select all

<table  border="0" width="1700" cellspacing="0" cellpadding="0"> 
<tr> 
<td>row 1</td> 
<td>row 2</td> 
<td>row 3</td> 
<td>row 4</td> 
<td>row 5</td> 
<td>row 6</td>
<div style="page-break-before:always"></div> 
<td>row 7</td> 
<td>row 8</td> 
<td>row 9</td> 
<td>row 10</td> 
<tr> 
<tr> 
<td>row 1</td> 
<td>row 2</td> 
<td>row 3</td> 
<td>row 4</td> 
<td>row 5</td> 
<td>row 6</td> 
<div style="page-break-before:always"></div> 
<td>row 7</td> 
<td>row 8</td> 
<td>row 9</td> 
<td>row 10</td> 
<tr> 
</table>
Do I have to break at <tr>?