Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6064901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:19:51+00:00 2026-05-23T09:19:51+00:00

Given the following HTML document, I need to keep the Table title line on

  • 0

Given the following HTML document, I need to keep the “Table title” line on the same page as the <table> when being printed in IE8.

Despite the page-break-inside:avoid;, there is still a page break between the title and the table. My understanding of this suggests a page break should be avoided and the whole div pushed on to page 2.

The doctype is XHTML 1.0 Transitional, I have <meta http-equiv="X-UA-Compatible" content="IE=8" /> set to force IE8 into Standards Mode which supposedly supports this syntax, and I have verified the rendering is being done in standards mode by checking document.compatMode == "CSS1Compat". The XHTML is valid.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=8" /> 
  <title>Page title</title>
</head>
  <body>
    <h1>Page content</h1>
    this is some content
    <br />which<br />should<br />push<br />the<br />table<br />below<br />on<br />to<br />the<br />next<br />page<br />but<br />the<br />table<br />should<br />be<br />kept<br />together<br />if<br />at<br />all<br />possible<br />please!

    <div style="page-break-inside:avoid;">
      <p><strong>Table title which needs to be kept with the table</strong></p>
      <table>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
      </table>
    </div>
  </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:19:51+00:00Added an answer on May 23, 2026 at 9:19 am

    IE8 support for this feature is buggy.

    Although Internet Explorer for Windows version 8 supports the value avoid it is a little buggy in places. For example, if applied to a p element, the browser will try to avoid breaking the page inside the element as expected; but if applied to a ul element, the whole list is not set to avoid as the list may span the two pages. That said, the individual list element will try to avoid having a page break inside.

    From this example, we can conclude it will try to not break the page inside the p, nor inside the table, but it won’t combine both. You can test it by having a really long text in your <p>.

    A way to fix this would be to include your title in your table :

      <table style="page-break-inside:avoid;" border="1">
        <tr><th colspan="3">Table title which needs to be kept with the table</th></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        <tr><td>one</td><td>two</td><td>three</td></tr>
        [...]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a single line regex which does the following: Given a HTML
Given the URL (single line): http://test.example.com/dir/subdir/file.html How can I extract the following parts using
Given the following HTML: <select name=my_dropdown id=my_dropdown> <option value=1>displayed text 1</option> </select> How do
Given the following XML structure <html> <body> <div> <span>Test: Text2</span> </div> <div> <span>Test: Text3</span>
Given the following: declare @a table ( pkid int, value int ) declare @b
Given the the following javascript function, function switch_plug_drop_down(plug_id) { selector = document.getElementById('group_1'); if (plug_id
Given the following HTML file: <!DOCTYPE html5> <html> <head> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js type=text/javascript></script> <script type=text/javascript>
I have a simple html table which has several rows. the following is implemented
Given the following HTML fragment: <p id=para>hello &lt;world&gt;</p> The jQuery .text() and .html() methods
Given the following HTML structure: <input class=addon-thumb type=checkbox name=foo/><label for=foo><img class=addon-thumb src= title=bar alt=foo/></label>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.