Click here to get back home

Setting an image as background to a table cell.

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Setting an image as background to a table cell. Doug Laidlaw 09-27-2005
Posted by Doug Laidlaw on September 27, 2005, 5:54 pm
Please log in for more thread options


HTML validators say that "background" is not a valid attribute for a <td>
tag

I want to set an image as the background for one cell only, and to have the
cell content on top of it. If I can't use <td background="img
src=.."></td>, what is the correct method?

Some modern templates do it all with CSS, but that is getting a bit too deep
for my inexperience.

A URL is probably unnecessary, but here it is:
http://www.douglaidlaw.net/boykett/index.html

At the moment, it is a mess: too many tables within tables. The image of
the ship is the one in question. I want to re-do it from the bottom up,
and code the cell correctly in the process.

Doug.
--
Registered Linux User No. 277548. My true email address has hotkey for
myaccess.
There is nothing so strong or safe, in any emergency of life, as simple
truth.
- Charles Dickens


Posted by Jim Moe on September 28, 2005, 12:34 am
Please log in for more thread options


Doug Laidlaw wrote:
> HTML validators say that "background" is not a valid attribute for a <td>
> tag [...] If I can't use <td background="img
> src=.."></td>, what is the correct method?
>
style="background: url('images/gipsy.jpg')"

> Some modern templates do it all with CSS, but that is getting a bit too deep
> for my inexperience.
>
Layout style should be done with style sheets.

> A URL is probably unnecessary, but here it is:
> http://www.douglaidlaw.net/boykett/index.html
>
I would not have bothered without an URL.

> At the moment, it is a mess: too many tables within tables. The image of
> the ship is the one in question. I want to re-do it from the bottom up,
> and code the cell correctly in the process.
>
Start by specifying HTML 4.01 Strict and resolving all those validation
errors. Oh, and provide a character encoding; a common one for English
(and many Europeans) is
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">.
UTF-8 is popular, too.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)

Posted by Doug Laidlaw on September 28, 2005, 8:48 pm
Please log in for more thread options


Jim Moe wrote:

> Doug Laidlaw wrote:
>> HTML validators say that "background" is not a valid attribute for a <td>
>> tag [...] If I can't use <td background="img
>> src=.."></td>, what is the correct method?
>>
> style="background: url('images/gipsy.jpg')"
>
>> Some modern templates do it all with CSS, but that is getting a bit too
>> deep for my inexperience.
>>
> Layout style should be done with style sheets.
>
>> A URL is probably unnecessary, but here it is:
>> http://www.douglaidlaw.net/boykett/index.html
>>
> I would not have bothered without an URL.
>
>> At the moment, it is a mess: too many tables within tables. The image of
>> the ship is the one in question. I want to re-do it from the bottom up,
>> and code the cell correctly in the process.
>>
> Start by specifying HTML 4.01 Strict and resolving all those validation
> errors. Oh, and provide a character encoding; a common one for English
> (and many Europeans) is
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">.
> UTF-8 is popular, too.
>
Thanks. I normally use HTML Validator Lite. It didn't pick up the
particular error, but it has before. (It did say that there was an error
that the Pro version would have identified.) I have a good handbook on
basic CSS and DHTML. Since I am strictly an amateur, and against too many
gimmicks, I haven't gone deeply into DHTML. I dislike sites that have
Flash just for the sake of having Flash. A method of covering all browsers
might however be desirable.

Doug.
--
Registered Linux User No. 277548. My true email address has hotkey for
myaccess.
It's all right letting yourself go as long as you can let yourself back.
-- Mick Jagger.


Posted by twaddle on October 2, 2005, 10:54 pm
Please log in for more thread options


Doug Laidlaw wrote:
> Thanks. I normally use HTML Validator Lite.

Would that be "CSE HTML Validator ( htmlvalidator.com )? You should
know that it is not a validator, no matter what it calls itself. These
are.

http://validator.w3.org/
http://www.htmlhelp.com/tools/validator/


> It didn't pick up the particular error, but it has
> before. (It did say that there was an error that the
> Pro version would have identified.)

Sounds like CSE. It's possibly useful for the hints it gives, but it
does not validate the page, i.e. compare it to the doctype you declare
you use. You can see the effect that can have here:
<http://online.htmlvalidator.com/php/onlinevallite.php?url=http://w3c.org>

Hint -- that page does not have 20 errors.

--
twaddle


Posted by Rincewind on September 28, 2005, 12:51 pm
Please log in for more thread options


On Tue, 27 Sep 2005 17:54:32 +1000, Doug Laidlaw wrote:

> At the moment, it is a mess: too many tables within tables. The image of
> the ship is the one in question. I want to re-do it from the bottom up,
> and code the cell correctly in the process.

You can say that again:-) No offence intended but if you are going to redo
the site/page then I would throw away NVU there website says <quote>The
current HTML typing rules were written with HTML mail generation very much
in mind; they are not optimal for web page writing, and we are aware of
this.</quote>.

You would be much better of with a plain text editor for writing the page,
a copy of Firefox for constant checking of what you are doing and bookmarks
to the W3c validation sites for HTML and CSS http://validator.w3.org/ and
http://jigsaw.w3.org/css-validator/, only after you have it looking as you
would like in FF check with IE.

> Some modern templates do it all with CSS, but that is getting a bit too deep
> for my inexperience.

It's really not as difficult as you may think there a plethora of articles
on how to code with CSS and HTML a quick Google just returned "118,000,000
for CSS and HTML" a couple of useful ones are http://www.htmlgoodies.com/
and http://www.w3schools.com/default.asp and there is always this and other
newsgroups to help when you get stuck. You will find that it is much easier
to build a site when you separate the Style from the HTML.

Similar ThreadsPosted
Setting a Cell Image October 1, 2004, 3:01 am
Printing table cell background colors? June 10, 2005, 4:24 pm
Text and Image inside table Alight Text Left and Image right in same cell ?? October 24, 2006, 12:55 am
Tradeoffs of setting background-color on html vs. body? August 19, 2008, 12:41 pm
cell background color February 15, 2005, 1:23 pm
Aligning content in table cell to top of cell April 26, 2007, 1:56 pm
with background image - what's the right way? March 4, 2005, 5:51 pm
How do you make a table background cover whole table August 3, 2004, 9:49 pm
CSS Bug?? background-image - Not Refreshing October 25, 2005, 10:39 am
Background image not appearing December 29, 2005, 11:42 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap