SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Printing a table

    Hi all,

    Using javascript i print a table (window.print()). This table is too big to show it on 1 page, so it automatically prints mulitple pages. This is good, but the first 2 rows are on the first page, and all the other rows on the other pages. This only happens in IE (in firefox it works well).
    The table is created and filled dynamically.

    Screenshot of the *.xps file

    i hope you can help me,
    regards

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Can you give us a link to the page itself? The screenshot doesn't show us what's actually happening behind the scenes.

  3. #3
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for your reply
    it's an offline page for the local network only.
    but here are some pieces of php where the table gets filled:
    (i'm going to optimize the code later, so don't be too critical )
    PHP Code:
    if($weeknr2 == $weeknr){
                        echo 
    "<td" $bgcolor "><br />" $day "</td>";
                    }else{
                        echo 
    "<td" $bgcolor "><font color='red'>".$weeknr."</font><br />" $day "</td>";
                    } 
    PHP Code:
    echo "<td $setkleur>" $dag[2] . "/<br />" $dag[1] . "</td>"
    PHP Code:
    echo "<tr><td bgcolor='" $kleur "' $style id='namen'><div id='w180'>" $row[1] . "</div></td><td $style><div id='w110'>" $row[3] . "</div></td>";
     if(
    $rows1){
                                echo 
    "<td $style><div style='background-color:".$kleur1.";' id='div1'><h6 id='h61'>" $vrij $content1 $vrij2 "</h6></div><div style='background-color:".$kleur2.";' id='div1'>" $vrij $content $vrij2 "</div></td>";
                            }else{
                                echo 
    "<td $style><h6 style='background-color:".$kleur1.";' id='content2'>" $vrij $content1 $vrij2 "</h6><div style='background-color:".$kleur2.";' id='div1'>"$vrij $content $vrij2 "</div></td>";
                            } 
    it's pretty hard to find the exact lines of code, but this should be something like it. (mostly because the function is over 300 lines)..

  4. #4
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Sorry, but raw PHP isn't a lot of use to me ... can you post the HTML source code that comes out as a result?

  5. #5
    SitePoint Member
    Join Date
    Feb 2011
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It won't let me post the entire code here, so i uploaded it to some free hosting website
    click

    edit:
    i just noticed Firefox prints it out correctly without the spacing, but IE still has the issue.
    Also, when i print regular, so not landscape, (don't know what it's called in English), it shows up ok. still not perfect but the white spacing is gone.

  6. #6
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    The two main types of printing orientation are; Portrait (longer height than width ratio) and Landscape (longer width ratio than height).


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •