No background?

F

Frogleg

I just went to the W3C Validator and it tells me:

Line 50, column 75: there is no attribute "BACKGROUND"

...." cellspacing="0" width="100%"
background="images/grad4bopaque.gif">

(The page is supposed to be HTML 4.01 Transitional.)

Could someone please explain this without saying "don't use tables;
use CSS"?
 
B

Barry Pearson

Frogleg said:
I just went to the W3C Validator and it tells me:
Line 50, column 75: there is no attribute "BACKGROUND"
..." cellspacing="0" width="100%"
background="images/grad4bopaque.gif">
(The page is supposed to be HTML 4.01 Transitional.)

It appears that "background" only applies to <body>:
http://www.w3.org/TR/html401/index/attributes.html

You can apply a background image to a table using CSS. (You need to get the
image path relative to the CSS path, not the document path).

table {
background-image: url("images/grad4bopaque.gif");
}
Could someone please explain this without saying "don't use tables;
use CSS"?

Always use CSS. And *also* use tables if you want. What harm does it do?

Have a look at things you can do with CSS & tables:
http://www.barry.pearson.name/tableaux/
 
K

Kris

Frogleg said:
I just went to the W3C Validator and it tells me:

Line 50, column 75: there is no attribute "BACKGROUND"

..." cellspacing="0" width="100%"
background="images/grad4bopaque.gif">

(The page is supposed to be HTML 4.01 Transitional.)

Could someone please explain this without saying "don't use tables;
use CSS"?

Use CSS on your tables instead of deprecated presentational markup.
Better of course is to drop *all* presentational markup, but you have
explained that you are not ready for that yet.

<table background="foo.jpg" cellpadding="4" ...>

Would become:

<table ...>

With some CSS:

table {
color: #000;
background: url(foo.jpg);
}

td {
padding: 4px;
}
 
W

Whitecrest

I just went to the W3C Validator and it tells me:
Line 50, column 75: there is no attribute "BACKGROUND"
..." cellspacing="0" width="100%"
background="images/grad4bopaque.gif">
Could someone please explain this without saying "don't use tables;
use CSS"?

The two are not mutually exclusive.

Now re-read what you just asked and tell me if you could answer it
without making a ton of assumptions.
 
B

Barry Pearson

Kris said:
Every time you use a table for layout, God kills a kitten.

Gosh! Widespread mayhem.

Toby A Inkster said:
Top 10 reasons for not using layout tables:
1. Every time you use a table for layout a puppy dies.

Thank God I'm an atheist!
 
K

Karl Groves

Karl Groves said:
<p style="dog_person">Good!</p>

good lord. someone smack me.
I dunno what's worse. writing "style" instead of "class" on such a lame
joke, or writing this retraction.

-Karl
 
K

Kris

Every time you use a table for layout, God kills a kitten.

Gosh! Widespread mayhem.

Toby A Inkster said:
Top 10 reasons for not using layout tables:
1. Every time you use a table for layout a puppy dies.[/QUOTE]

And we're gonna tell you again.. and again.. and again.. and again..
 
B

Barry Pearson

Kris said:
Gosh! Widespread mayhem.

Toby A Inkster said:
Top 10 reasons for not using layout tables:
1. Every time you use a table for layout a puppy dies.

And we're gonna tell you again.. and again.. and again.. and again..[/QUOTE]

It'll be sparrows next. I don't see many of those at my bird table
..............
 
F

Frogleg

It appears that "background" only applies to <body>:
http://www.w3.org/TR/html401/index/attributes.html
It's Homesite's fault. Its little pop-up helper offers one
'background' for TABLE or TD, and its error checker is fine with it.
You can apply a background image to a table using CSS. (You need to get the
image path relative to the CSS path, not the document path).

Yeah. That's what I did, but I wasn't happy about it.
Always use CSS. And *also* use tables if you want. What harm does it do?

Indeed. I beat my brains out for a couple of days trying to do the
page without tables and then decided I was being stupider than usual,
and got things lined up in a trice.
Have a look at things you can do with CSS & tables:
http://www.barry.pearson.name/tableaux/

Very nice. I just glanced, but will go back.
 
R

rf

Frogleg said:
In a nutshell, I would like to do this:

http://home.earthlink.net/~absolutelyfake/dilemma.htm

with correct HTML/CSS.

This, even though wrong, shows up the way I want it in IE 6 and
Mozilla 1.6 -- a background image on the page, and a *different*
background overlaid for the table.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<HEAD>
<style type="text/css">
body {background-image: url(index_files/mymap.gif)}
table {background-image: url(index_files/gradred.gif)}
</style>
</HEAD>
<BODY >
<TABLE width="100%" border=1>
<TR>
<TD>
<H1>A table</H1><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR></TD>
<TD>
<H1>with two cells</H1>
</TD>
</TR>
</TABLE>
</BODY>
</html>


http://users.bigpond.net.au/rf/frog/
 
W

Whitecrest

In a nutshell, I would like to do this:

http://home.earthlink.net/~absolutelyfake/dilemma.htm

with correct HTML/CSS.

This, even though wrong,

Why is it wrong?
shows up the way I want it in IE 6 and
Mozilla 1.6 -- a background image on the page, and a *different*
background overlaid for the table.

CSS can easily do this (as can the tables) look at http://glish.com/css/
They several examples, one of them is exactly what you are trying to do.
CSS design is great, but many here use a combination of CSS and Tables.
Use whish ever is best for the specific issue. Then you are always
right.
 
P

PeterMcC

Barry Pearson wrote in
It'll be sparrows next. I don't see many of those at my bird table

They'll be back - they're just waiting until all the dogs and kittens have
been killed.

BTW, once the kitten's been killed, is it OK to lay it out in a frame on a
table?
 
E

Els

PeterMcC said:
Barry Pearson wrote in


They'll be back - they're just waiting until all the dogs
and kittens have been killed.

BTW, once the kitten's been killed, is it OK to lay it out
in a frame on a table?

<g>
 
F

Frogleg

CSS can easily do this (as can the tables) look at http://glish.com/css/
They several examples, one of them is exactly what you are trying to do.
CSS design is great, but many here use a combination of CSS and Tables.
Use whish ever is best for the specific issue. Then you are always
right.

Thanks. I bookmarked glish and found I already had it bookmarked.
Maybe I should also *look* at it. :)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top