why on earth doesnt this work?!

  tomleady 16:25 08 Dec 2003

i'm probably missing something obvious here, but why doesnt this work?!?

if you could download the zip file i link to, could you please try it for me?!

if you extract it, it should give a single html file, and a folder called "_images", in that are four jpgs, one called "banner".

in dreamweaver,the banner at the top appears ok. but when i launch it in IE, it doesnt! i have looked at everything i cn think of, so i must be missing something really obvious.

click here

hope that link works.

thanks in advance. Tom

  Taran 16:37 08 Dec 2003

You have your image source file in the wrong tag.

Move it from the <TR> tag to the <TD> tag below it, like this:

<TD colSpan=2 background="_images/banner.jpg"><font face="Verdana, Arial, Helvetica, sans-serif" size="4" color="#FFFFFF">0.
Aims and Outcomes</font></TD>

Job done.


  Sir Radfordin 16:55 08 Dec 2003

Taren may be right (he normaly is) but...

I can actually recreate the same problem from scratch using DWMX. Playing around with it, there seems to be a bug when you put a background on a merged cell. If you play around with the cells some more it sorts itself out!

To create the problem:

Open up a blank file and create a table

4 row 2 col
make the table 100% wide

merge col 1&2 on rows 1, 2, and 3

Save the file. Now put in a background image on row 2 and the code you get is:

<table width="100%">
<td colspan="2"> </td>
<tr background="_images/bituptop.jpg">
<td colspan="2"> </td>
<td colspan="2"> </td>
<td width="74%"> </td>
<td width="26%"> </td>

  Taran 17:07 08 Dec 2003

The <tr> tag refers to one row while the <td> tag is for one cell. You can put code into a <tr> tag but the fix, in this case, is to move the image reference.

I should have been more specific other than saying outright that you had used the wrong tag which, in fact, you hadn't.


  Sir Radfordin 17:10 08 Dec 2003

The code I've pasted in is the code that DW produces in WYSIWYG mode - hence why I think tomleday had the problem?!

  tomleady 17:52 08 Dec 2003

taran, cheers mate. its solved!

well done for spotting that. i would never had. it all makes sense know!

but why does Dreamweaver show it? program fault? or one of those annoying HTML things?

thanks again!


  Taran 19:40 08 Dec 2003

"Safe" HTML is colours for <TR> backgrounds and colours and/or images for <TD> tags.

Without going off on one in explanations, the <TR> is a row container for the table it sits in and one of the things it contains is a <TD> - a table cell.

You can assign colours as a row background, but for safe interpretation by your browser you should only assign background images to the cell within the row.

So you were right tomleady, when you asked if it was "one of those annoying HTML things".

Dreamweaver and all other WYSIWYG editors often does not stop you making mistakes and this is an example of one of them it will cheerfully let you get on with.

In fact, I've just done Sir Radfordin's experiment myself and it does exactly what he says, allowing you to introduce errors. Even the mighty Dreamweaver is not infallible.

Yet if you use the O'Reilley HTML Reference in Dreamweaver it tells you what your HTML tags are and describes what they do and why. You will also find that if you go into code view with Dreamweaver it will not allow you to link a background image into a <tr> tag at all, but it will allow you to do so in a <td> tag - correct so far.

WYSIWYG is not in fact what you see is what you get in this case...

This is where knowing a little HTML can save the day which is why I always recommend people treat Dreamweaver and similar programs as a basis to work from with normally excellent output, but not as the be-all-and-end-all some would have you believe it is. It's good, but even at £350 or so and despite its reputation of the one web authoring program everyone should have, you can still throw up issues with something as simple as assigning background images to table elements.

Go figure.



  Taran 20:42 08 Dec 2003

I've just run Sir R's experiment a second time with Dreamweaver.

This time though, once the table cells have been merged in design view I went into code view.

Attempting to assign a background image to the <tr> tag failed in code view - it would only (correctly) allow it in the <td colspan="2"> tag.

So it proves that the WYSIWYG deign view mode is the problem here and not everything you see is, in fact, what you will get.

Very Twilight Zone...

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Samsung Galaxy S9 review

Adobe price increase confuses customers

What to expect at Apple's 27 March education event

Comment filmer l’écran d’un iPhone ?