• CSS: page-break-inside

    Author
    Topic
    #429650

    Hello All!
    I’m having trouble implementing a page-break-inside tag within my dynamic web page. The main piece of the page is a repeater, which creates a table for each row returned in the DataSource. It currently will break the table in the middle when a page break is encountered. I’m hoping to have it not break the table in the middle, and I assume this is the tool to use. Here is the relevant section of code, I’m just not sure where the page-break tag should go:

    Project Name:
    Viewing 1 reply thread
    Author
    Replies
    • #1001332

      This is interesting advice, from CSS Page-break-inside Property: “Use the page-breaking properties as few times as possible and avoid page-breaking properties inside tables…”

      In your code example, you have a

      in an invalid or at least unhelpful location. A

      inside a table cell (

      ) should be interpreted correctly, but a

      before a cell should implicitly be closed before that cell and therefore have no effect.

      You could try applying the style to your

      elements and see whether that works:

      tr {page-break-inside: avoid}

      Or maybe you need to apply that to

      elements. I’m not 100% clear from this: http://www.w3.org/TR/REC-CSS2/page.html#allowed-page-breaks%5B/url%5D
    • #1001430

      Hi there

      I have never used this , so it is an interesting point you raised. I too had a look around the web and saw this link: http://www.htmlref.com/reference/appb/css_page-break.htm%5B/url%5D

      This is a particulary interesting link as it notates which browsers support the class

      • #1001440

        Thank you both for the assistance!

        I think I’ve decided that “avoid” is short for “avoid_if_not_inconvenient_to_do_so”. Upon further research, I altered the syntax a couple of different ways:

        …….etc.

        This still breaks the table in the middle at the end of the page.

        I also tried

        …..etc. (closing the

        after the

        )

        Same result here.

        I did discover that “page-break-after:always” spits out one instance of the table, then jumps to the next page.

        So far the only thing I’ve done to get by in the meantime is to adjust the pixel sizes on the font so it fully completes 6 rows to exactly fill the page.

        Thanks again.

    Viewing 1 reply thread
    Reply To: CSS: page-break-inside

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: