How to generate a table so that the background color is grey on a printout

Discussion in 'HTML' started by Stefan Mueller, Nov 24, 2005.

  1. I'd like to generate with PHP a HTML email which contains a table.
    The backgound color of the table is grey. But if you print the email or HTML
    page on a printer the background color of the table is not printed.

    td.style_tabletitle {
    font-family: verdana;
    font-size: 8pt;
    font-weight: bold;
    color: #000000;
    background-color: #666666;
    }

    <td width = "100%" class = "style_tabletitle">
    My table title
    </td>

    Is there any possibility to define the background of the table so that the
    background is also printed (only a light grey)?

    Stefan
    Stefan Mueller, Nov 24, 2005
    #1
    1. Advertising

  2. On Thu, 24 Nov 2005 17:05:06 +0100, Stefan Mueller
    <> wrote:

    > Is there any possibility to define the background of the table so that
    > the background is also printed (only a light grey)?


    There shouldn't be. You can suggest a grey background for the table in
    your style sheet for printing, but it is up to the visitor/user whether or
    not s/he wants the background colour actually printed. If so s/he will set
    it in the browser preferences. If not, too bad.


    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
    Barbara de Zoete, Nov 24, 2005
    #2
    1. Advertising

  3. Stefan Mueller

    Dylan Parry Guest

    Pondering the eternal question of "Hobnobs or Rich Tea?", Stefan Mueller
    finally proclaimed:

    > background color of the table is not printed.


    This is a browser setting that you can only change for your own machine,
    so nothing you do will make the background print on other peoples'
    printers unless you go round to their houses and reconfigure their
    browsers ;)

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references

    Usenet: The first post is free, but the next will cost you your soul.
    Dylan Parry, Nov 24, 2005
    #3
  4. Stefan Mueller

    Jim Higson Guest

    Stefan Mueller wrote:

    > I'd like to generate with PHP a HTML email which contains a table.
    > The backgound color of the table is grey. But if you print the email or
    > HTML page on a printer the background color of the table is not printed.
    >
    > td.style_tabletitle {
    > font-family: verdana;
    > font-size: 8pt;
    > font-weight: bold;
    > color: #000000;
    > background-color: #666666;
    > }
    >
    > <td width = "100%" class = "style_tabletitle">
    > My table title
    > </td>
    >
    > Is there any possibility to define the background of the table so that the
    > background is also printed (only a light grey)?


    Nope. In theory you can do this with CSS media selectors, but a lot of email
    clients (webmail ones especially) don't use CSS very well.

    See:
    http://www.alistapart.com/articles/cssemail/

    The user's email client might strip the background out anyway, but probably
    can't be relied on. Better to use print friendly colours to start with or
    just send plain text emails.
    Jim Higson, Nov 24, 2005
    #4
  5. Stefan Mueller

    wayne Guest

    Re: How to generate a table so that the background color is greyon a printout

    Stefan Mueller wrote:
    > I'd like to generate with PHP a HTML email which contains a table.
    > The backgound color of the table is grey. But if you print the email or HTML
    > page on a printer the background color of the table is not printed.
    >
    > td.style_tabletitle {
    > font-family: verdana;
    > font-size: 8pt;
    > font-weight: bold;
    > color: #000000;
    > background-color: #666666;
    > }
    >
    > <td width = "100%" class = "style_tabletitle">
    > My table title
    > </td>
    >
    > Is there any possibility to define the background of the table so that the
    > background is also printed (only a light grey)?
    >
    > Stefan
    >
    >

    Try this in your style sheet:

    @media print {
    td.style_tabletitle {
    background-color: #ffffff !important;

    }

    --
    Wayne
    http://www.glenmeadows.com
    wayne, Nov 26, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ray

    Too light grey color

    Ray, Oct 31, 2005, in forum: HTML
    Replies:
    3
    Views:
    4,341
    dorayme
    Oct 31, 2005
  2. Replies:
    8
    Views:
    931
    Andy Mabbett
    Jul 11, 2006
  3. fig000
    Replies:
    0
    Views:
    4,533
    fig000
    Sep 6, 2004
  4. Kamaljeet Saini
    Replies:
    0
    Views:
    388
    Kamaljeet Saini
    Feb 13, 2009
  5. Replies:
    1
    Views:
    258
    marss
    Feb 14, 2007
Loading...

Share This Page