SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Mar 2002
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question CSS: Avoiding page breaks within tables when printing

    I saw a session Eric Myer presented at Web2001. I remember he talked about being able to set page breaks for printed media. I have created a document that includes a number of tables (not for layout -- each contains a sample of tabular data). When I print the document, some of the pages break within tables. I looked at Eric's article at http://www.webreview.com/style/2000/01_07_00.shtml and at media and page information at w3.org. I came up with this:

    @media print {
    TABLE {page-break-inside: avoid }
    }

    But it isn't affecting where the page breaks occur. This statement is in the HEAD section of my document (with other CSS statements which do work). For this document I would prefer not to have an external CSS file so that it is self-contained. This page is for an intranet and we use IE 5.x. Can anyone tell me how to make this work?
    Last edited by mdg; Mar 14, 2002 at 12:35.

  2. #2
    SitePoint Addict Caterwomtious's Avatar
    Join Date
    Dec 2001
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a guess...

    IE5.x definitely supports stylesheets for different media, but does it support the various page break properties? It'd be worth testing that on some simple text, maybe comparing your results with other, newer browsers, before trying to get it to work with your table.

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think the TABLE might be the problem. Have you tried placing the content inside a DIV, or just loose inside your body tag? Have you take a look at www.w3c.org? That's the definitive guide as far as I am concerned.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    pg for mild peril cow's Avatar
    Join Date
    Mar 2000
    Location
    nevada, usa
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: CSS: Avoiding page breaks within tables when printing

    Originally posted by mdg

    @media print {
    TABLE {page-break-inside: avoid }
    }
    w3.org defines this, but i don't think any browsers support it. so i don't think there is any way to do it just yet.
    "There's no justice like angry mob justice!" --Seymour Skinner


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
  •