Results 1 to 4 of 4

Thread: How to put background color for html cell

  1. #1
    Join Date
    Feb 2009
    Posts
    78

    How to put background color for html cell

    How to use a dbhtml or dbfo file for processing instruction to set the background color for an individual table cell. The view should look like the following there should be number of tables and at the background the color would be anything.

  2. #2
    Join Date
    Jan 2009
    Posts
    99

    Re: How to put background color for html cell

    In my experience, reliable printing of HTML pages "in the wild" is impossible. Some browsers do not display a table cell's background color unless the cell contains some HTML content. One solution (and admittedly an imperfect one) that I have used is to use table cell background colors to "paint" a whole region a different color than the page background. Or to generate a PDF version of a page (genreated on the server) for printing.

  3. #3
    Join Date
    Oct 2008
    Posts
    83

    Re: How to put background color for html cell

    To ensure that every "empty" table cell displays background color, insert a non-breaking space ( ) in the table cell. CSS, currently at least, has no way to style an element based on anything that appears after the start tag for that element in the document. You could do this to your CSS:

    Code:
    td { height: 100%;}
    .bg { background-color: #f00; width: 100%; height: 100%; display: block; }

  4. #4
    Join Date
    Feb 2008
    Posts
    54

    Re: How to put background color for html cell

    My program makes an HTML report which needs to be easily printable. On this report is a table, and one of the columns in the table needs to express a color. The bottom row demonstrates what happens with no non-breaking spaces (the yellow will not display in some browsers).

    Code:
    <TABLE BORDER="1" CELLPADDING="0" CELLSPACING="2" WIDTH="400">
    	<TR>
    		<TD BGCOLOR="#ffcc00">Application</TD>
    		<TD BGCOLOR="#ffcc00">Benchmark</TD>
    		<TD BGCOLOR="#ffcc00">Results</TD>
    	</TR>
    </TABLE>

Similar Threads

  1. How to Set table with Html Background?
    By Aakarshan.d in forum Software Development
    Replies: 3
    Last Post: 26-11-2009, 01:22 PM
  2. How to set html text background
    By Broot in forum Software Development
    Replies: 3
    Last Post: 29-07-2009, 03:16 PM
  3. Cell Padding and Cell Spacing in HTML
    By Claudius in forum Software Development
    Replies: 3
    Last Post: 14-05-2009, 01:35 PM
  4. Flash as HTML background
    By Gap meer in forum Software Development
    Replies: 3
    Last Post: 23-04-2009, 10:33 PM
  5. XP Color theme with dark window background color?
    By sayeed in forum Windows XP Support
    Replies: 4
    Last Post: 27-06-2008, 01:42 AM

Tags for this Thread

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
  •  
Page generated in 1,713,306,966.77814 seconds with 17 queries