Problem with td rowspan

M

Martin Fuchs

hi there,

i have a problem with a table cell in my html code. well first my table
looks like the following:

<table width="748" border="1" cellspacing="0" cellpadding="0"
bgcolor="#FFFFFF">
<tr>
<td width="374" height="252" colspan="2" valign="top"> CONTENT 1
</td>
<td width="374" colspan="2" rowspan="2" valign="top"> CONTENT 2
</td>
</tr>
<tr>
<td width="187" colspan="2" valign="top" class="bg_green1"><img
src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
</table>

the table cell in the second table row should align top without any space to
the first table cell (containing CONTENT 1, an image).
i can't seem to get this table cell aligned top. tried a lot but could not
find any solution....

the real example can be found at
http://www.graphix.at/update_consulting/test/master_content_rechts.html

any help would be appreciated a lot!

thank you very much in advance and best greetings,

martin

(if you would like to e-mail me please remove NOSPA^M from my mail adress -
(e-mail address removed))
 
M

Martin Fuchs

hi sid,

thanks for those links but if you take a look at the source code of the
example i posted you will notice that i know html and that this code is
valid.
i just seem to oversee a little something and thought that i could get help.
 
M

Martin Fuchs

hey fredo,

i want to valign the table cell in the second table row with the first table
cell in the first table row. the table cell i want to valign has the
class="bg_green1"

do you know what i mean?

greetings, martin
 
F

Fredo Vincentis

Martin Fuchs said:
hey fredo,

i want to valign the table cell in the second table row with the first table
cell in the first table row. the table cell i want to valign has the
class="bg_green1"

But the cell with class bg_green1 is empty (except for a 1x1 spacer)? If you
put something into it, it is valigned. Perhaps can you explain a bit more in
visual terms what you want to achieve? The cell is currently empty and has a
green background. It is located to the left of your Welcome text. Do you
want the cell to appear at a different position? Or will you have something
inside the cell that you want valigned?
 
M

Martin Fuchs

Fredo Vincentis said:
But the cell with class bg_green1 is empty (except for a 1x1 spacer)? If you
put something into it, it is valigned. Perhaps can you explain a bit more in
visual terms what you want to achieve?

hi fredo,

well the position of the cell is alright. it's left to my welcome text and
beneith the cell containing the image.
what i want to achieve is that the table cell with the green background
valigns from just beneith the cell with the image to the bottom of the
table. if i write text into that cell the text valigns top within that cell,
but the cell does not valign up to the cell containing the image, so there
is white space under the image. do you know what i mean?

thanks, martin
 
F

Fredo Vincentis

Martin Fuchs said:
more

hi fredo,

well the position of the cell is alright. it's left to my welcome text and
beneith the cell containing the image.
what i want to achieve is that the table cell with the green background
valigns from just beneith the cell with the image to the bottom of the
table. if i write text into that cell the text valigns top within that cell,
but the cell does not valign up to the cell containing the image, so there
is white space under the image. do you know what i mean?

Ah, okay. What you actually want is not valign - valign is only to align
content that is sitting inside a table cell, not for the cell itself.

To be honest, I think the easiest solution would be not to break the left
half into two rows, but rather make it one big cell. The entire left cell
could have your green background (the colour wouldn't be visible behind the
image anyway, so it would start after the image is finished).

For example:

<table>
<tr>

<td class=bg_green1>
<img src="uc01.jpg"><br>
<!-- here starts the green area. You can insert some content, if you want or
leave it empty -->
</td>

<td>
Willkommen bei Update, etc etc.
</td>

</tr>
</table>

An even nicer solution would be to forget about tables and use css to layout
the site. It makes the code much cleaner and has several advantages in
accessibility.

Does this help?
 
M

Martin Fuchs

Fredo Vincentis said:
To be honest, I think the easiest solution would be not to break the left
half into two rows, but rather make it one big cell.

hi fredo,

i decided to do it like this (nor braking the left cell into two rows,
although i just dont understand why this code does not work. opera 7
displays everything right. ie and ns dont... well it works at least without
two table rows.

thanks for your help!

greetings,
martin
 

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,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top