PDA

View Full Version : Applying a background image to a table with 3 row/colum,HOW?


3dmaya
04-28-2007, 03:06 AM
hi everyone.

how can I apply a background image to a table with 3 row/colum.
I want all the cell gets 1 beckground image without repeating.

please help if you know the code or how to fix it, I know it is very easy question. but sometime the easy question could be a nightmerry.

Antonio Australia

Andromeda
04-28-2007, 03:31 AM
Hi 3dmaya

The code you need is in red

<table width="85%" border="0" cellpadding="0" cellspacing="0" background="whatever">

3dmaya
04-28-2007, 08:54 AM
Andromeda thanks for replay. I try this code but doesn't help. need more explanation please.
background="whatever"=? what you mean with whatever?

here is my script.
<td height="98" align="left" valign="baseline" background="../MyDocuments/dubai3d/menu.jpg" style="
background-repeat: no-repeat;" > </td>
so where do you want me put the code. I try the red code ,but no.

please more explain or other script , thanks again. hear from you soon

Andromeda
04-28-2007, 08:17 PM
Sorry if I confused you!! What I meant by "whatever" was whatever the name of your image was so, with the new info you've given me your code should read:

<table background="../MyDocuments/dubai3d/menu.jpg" background-repeat: no-repeat;" >

See that I've taken the background information out of the <td> tag and put it in the <table> tag.

A <td> tag refers to only one cell. A <table> tag refers to the whole table. At the moment you've got the background set in a <td> tag. Which means you are setting the background to a cell only. But you need to set the background to the whole table so it needs to go in the <table> tag not the <td> tag.

NOTE: After you have set the background to the <table> tag make sure that you take the background out of your <td> tag.

3dmaya
04-28-2007, 09:31 PM
thanks andromeda that helps, I trid , that was perfect, but here another question,

I made a table with 3 row. I split the second row to 3 colum. (making the txt menu) now how can I applay a bground image to the 3 cell(not to the table, only to the 3 cells)
have a look at the image attachment. I create 1 table with 3 row. and I apply the image bground to the first row/cell and it is good.
but I split the second row to 3 colum and now the second row has 3 cells.

how can I apply a(1) bground image to all 3 cells/colums?

I trid , but DW applay for every cell individual a bg image.

any idee people?

image is attached.

Andromeda
04-29-2007, 01:19 AM
Below is some basic code for a 3 x 3 table (3 rows, 3 columns). Code in black - my comments in red.

<table> This is where your table starts
<tr> This is the first row of your table
<td>&nbsp;</td>This is where your first and only cell of this row starts and finishes.
</tr>This is the end of your first row
<tr> This is the beginning of your second row.
<td>&nbsp;</td>The first cell in your second row starts and finishes.
<td>&nbsp;</td>The second cell in your second row starts and finishes.
<td>&nbsp;</td>The third cell in your second row starts and finishes.
</tr>Your second row finishes.
<tr> Your third row starts
<td>&nbsp;</td>Your first and only cell of the third row starts and finishes.
</tr>Your third row finishes.
</table>This is where your table finishes.

I'm unsure if you want just the second row to contain a background image or whether you want the first two rows to contain a background image so I'll give both.

If you want the first two rows to show the image
The code could look like this: (changes to the previous code are in red)

<table background="images/bround001.jpg">
<tr>
<td>&nbsp;</td>
</tr>
<td >&nbsp;</td>
<td >&nbsp;</td>
<td >&nbsp;</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">&nbsp;</td>
</tr>
</table>

What I've done is to give the whole table a background image and then for the very last row, I've told the cell to have a white background - this overrides the table background.

If you want just the second row to have the background image:
I thought that maybe you could just set the table row to have the background but it doesn't seem to work without getting three images rather than one so you could do this instead:

<table background="images/bround001.jpg">
<tr>
<td bgcolor="#FFFFFF">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#FFFFFF">&nbsp;</td>
</tr>
</table>

What I've done is to set the whole table with the background and then for all the cells that I didn't want the background in, I made the background colour white. (#ffffff is the colour code for white).

Just for your info the "&nbsp;" which you see in the cells simply means a space.

3dmaya
04-29-2007, 01:35 AM
hi Andromeda. thanks alot for explanation of the code. you are the man,
really amazing. I'm going to try this code's. see what happend.

thanks again and perfect explaination. you should be teacher.

I let you know soon.

Andromeda
04-29-2007, 01:44 AM
hi Andromeda. thanks alot for explanation of the code. you are the man,

:lol: LOL! Lady actually - but you're not the only one who assumed otherwise!

3dmaya
04-29-2007, 04:54 AM
ohhhh. sorry.I didn't know that. anyway you are the best & smart.

have a nice day

cheers Antonio- adelaide(with full of raining)