Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How to put background color for html cell

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 07-08-2009
Member
 
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.

Reply With Quote
  #2  
Old 07-08-2009
Member
 
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.
Reply With Quote
  #3  
Old 07-08-2009
Member
 
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; }
Reply With Quote
  #4  
Old 07-08-2009
Member
 
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>
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 01:46 AM.