Jump to content

line-height affecting page-break-before


jandrews3
Go to solution Solved by jandrews3,

Recommended Posts

If I set the line-height in this code for anything less than 23, the iPad adds an extra page between pages yet the desktop prints normal.

 

$querys = "SELECT * FROM inno_students WHERE teacher = '".$_SESSION['staff']['uname']."' AND course_id = '$course_id' ORDER BY lname, fname";
$results= mysql_query($querys) or die("Could not perform query: ".mysql_error());
while ($rows = mysql_fetch_array($results)){
 
print "<div style=\"font-size: 12pt; line-height: 22px; ".$page."\">";
$page = "page-break-before: always;";
print "<p align=\"center\" style=\"font-size: 15pt; font-weight: bold; margin: 0px 0px;\">\n";
print "Skill Remediation<br><span style=\"font-size: 12pt;\">".$subject."</span>\n";
print "</p>\n";
 
print "<p align=\"right\" style=\"margin: 0px 0px;\">\n";
print "Name: <b>".$rows['lname'].", ".$rows['fname']."</b><br>\n";
print "Today's date: <b>".date("M j")."</b><br>\n";
$today = date("U");
$due = $today + (86400*3);
print "Due date: <b>".date("M j", $due)."</b><br>\n";
print "</p>\n";
 
print "</div>";
 
}
 
Link to comment
Share on other sites

  • Solution

The first line in the <div> contained text with font-size 15pt but yet a line-height of 16px (at least, it did initially). That is apparently what caused it. If I shrink the font-size of the first line, the first line only, then the problem disappears. Apparently the line-height was too small for the font-size, which translated into a paging problem since it was the first line of the page.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.