Image in a table in XHTML.

Image in a table in XHTML.

am 06.12.2007 02:19:04 von showandbeshown

Hi,

I use xhtml and I need to create a simple table which consists of 2
columns and 1 row. The firs column of the table will contain some text
and the second one an image. The width of the both columns is fixed
and the height of the row is defined by the amount of the text in the
first column. I would like my image adjusts the hight of the row (i.e.
automatically stretches if it is needed).

Is that possible to do within xhtml? I now that I can set the height
of the image explicitly. I need to do something like height=100%. But
it seems to be not supported in xhtml.

Thank you in advance.

Re: Image in a table in XHTML.

am 06.12.2007 03:13:53 von showandbeshown

I found something that looks like what i need:


However, it does not work. :) Why? I do explicitly say that the image
should take the 100% of the height and it does not take. You can see
how it looks like here:
http://www.showandbeshown.com/headtail.php

Re: Image in a table in XHTML.

am 06.12.2007 03:20:36 von rf

wrote in message
news:80dec378-5cf8-4b3b-87ab-2a5adaa88108@j44g2000hsj.google groups.com...
>I found something that looks like what i need:
>

> However, it does not work. :) Why? I do explicitly say that the image
> should take the 100% of the height and it does not take. You can see
> how it looks like here:
> http://www.showandbeshown.com/headtail.php

You should be using l.jpg as a background for that cell. It wall
automatically repeat and fill up the cell.

--
Richard.

Re: Image in a table in XHTML.

am 06.12.2007 03:29:26 von showandbeshown

On Dec 5, 9:20 pm, "rf" wrote:
> wrote in message
>
> news:80dec378-5cf8-4b3b-87ab-2a5adaa88108@j44g2000hsj.google groups.com...
>
> >I found something that looks like what i need:
> >
> > However, it does not work. :) Why? I do explicitly say that the image
> > should take the 100% of the height and it does not take. You can see
> > how it looks like here:
> >http://www.showandbeshown.com/headtail.php
>
> You should be using l.jpg as a background for that cell. It wall
> automatically repeat and fill up the cell.
>
> --
> Richard.

If I use , it helps only but only
partially. Because, it looks like I want, but the document becomes
"not valid xhtml document" since "there is not background attribute
for the element".

Re: Image in a table in XHTML.

am 06.12.2007 03:41:37 von rf

wrote in message
news:588b2edb-3ad5-4968-961c-ed5cb60db3b5@w40g2000hsb.google groups.com...
> On Dec 5, 9:20 pm, "rf" wrote:
>> wrote in message
>>
>> news:80dec378-5cf8-4b3b-87ab-2a5adaa88108@j44g2000hsj.google groups.com...
>>
>> >I found something that looks like what i need:
>> >
>> > However, it does not work. :) Why? I do explicitly say that the image
>> > should take the 100% of the height and it does not take. You can see
>> > how it looks like here:
>> >http://www.showandbeshown.com/headtail.php
>>
>> You should be using l.jpg as a background for that cell. It wall
>> automatically repeat and fill up the cell.
>>
>> --
>> Richard.
>
> If I use , it helps only but only
> partially. Because, it looks like I want, but the document becomes
> "not valid xhtml document" since "there is not background attribute
> for the element".

Then specify it using CSS.

XHTML is not viable on the web anyway. IE simply does not understand it and
you are serving it up as as text/html so browsers are error correcting it
back to HTML anyway.

HTML 4.01 strict is the way to go.

--
Richard.

Re: Image in a table in XHTML.

am 06.12.2007 03:52:53 von dorayme

In article
m>,
showandbeshown@gmail.com wrote:

> Hi,
>
> I use xhtml and I need to create a simple table which consists of 2
> columns and 1 row. The firs column of the table will contain some text
> and the second one an image. The width of the both columns is fixed
> and the height of the row is defined by the amount of the text in the
> first column. I would like my image adjusts the hight of the row (i.e.
> automatically stretches if it is needed).
>
> Is that possible to do within xhtml? I now that I can set the height
> of the image explicitly. I need to do something like height=100%. But
> it seems to be not supported in xhtml.
>
> Thank you in advance.

Amazingly:

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



Fit to cell







Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque augue.Lorem ipsum dolorLorem ipsum dolor sit amet,
consectetuer adipiscing elit. Pellentesque augue.Lorem ipsum
dolorLorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque augue.Lorem ipsum dolor





works, or at least gives the illusion, only in Safari 2.0.4 on a
Mac.

I think you will really require scripting for the img to reliably
get the height of the left cell depending on the user font size
etc...

--
dorayme

Re: Image in a table in XHTML.

am 06.12.2007 12:53:32 von Shion

showandbeshown@gmail.com wrote:
> On Dec 5, 9:20 pm, "rf" wrote:
>> wrote in message
>>
>> news:80dec378-5cf8-4b3b-87ab-2a5adaa88108@j44g2000hsj.google groups.com...
>>
>>> I found something that looks like what i need:
>>>
>>> However, it does not work. :) Why? I do explicitly say that the image
>>> should take the 100% of the height and it does not take. You can see
>>> how it looks like here:
>>> http://www.showandbeshown.com/headtail.php
>> You should be using l.jpg as a background for that cell. It wall
>> automatically repeat and fill up the cell.
>>
>> --
>> Richard.
>
> If I use , it helps only but only
> partially. Because, it looks like I want, but the document becomes
> "not valid xhtml document" since "there is not background attribute
> for the element".

I'm guessing you want a fluid rounded corner box with transparent corners?

If so, you could do it this way:

http://www.lester1.eclipse.co.uk/1/

It's ugly, but not as ugly as your table version.

This uses a variation of the "sliding doors" technique, which basically
uses a very wide corner image to span the entire width of the box and
"slide out" when the box expands. Transparency causes quite a few issues
with sliding doors, which is usually done using nested divs. That's why
I had to resort to empty divs.

There might be a more elegant way of doing this with transparent corners
but I can't think of one.