Click here to get back home

table: valign-top problem

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
table: valign-top problem maya 02-15-2008
Get Chitika Premium
Posted by maya on February 15, 2008, 3:50 pm
Please log in for more thread options

I have an image and right next to the image I have some text, all w/in
the same <td>.. but, even though I have valign="top" for the <td>, the
text does not appear on top of the <td>, it appears flush with the
BOTTOM of the image..

pls see http://www.mayacove.com/misc/table/table.html

not sure how to solve this, "text-align:top" does not exist in css....;)

thank you..




Posted by Beauregard T. Shagnasty on February 15, 2008, 4:06 pm
Please log in for more thread options
maya wrote:

> I have an image and right next to the image I have some text, all w/in
> the same <td>.. but, even though I have valign="top" for the <td>,
> the text does not appear on top of the <td>, it appears flush with
> the BOTTOM of the image..

That is because the baseline of the image and the text is the same.

> pls see http://www.mayacove.com/misc/table/table.html
>
> not sure how to solve this, "text-align:top" does not exist in css....;)

<td class="pad10" valign="top">
<span style="float: left; padding-right:0.5em;">
<img alt="<something>" class="imgSponsored"
src="http://www.mayacove.com/misc/table/images/88.gif" width="88"
height="31">
</span>
<a href="" class="green13">aaaaaaaaaa</a>
</td>

Don't forget the images' heights and widths. I would also move
presentational stuff into your style sheet, such as

td {
vertical-align: top;
}

--
-bts
-Motorcycles defy gravity; cars just suck

Posted by Jonathan N. Little on February 15, 2008, 4:09 pm
Please log in for more thread options
maya wrote:
>
> I have an image and right next to the image I have some text, all w/in
> the same <td>.. but, even though I have valign="top" for the <td>, the
> text does not appear on top of the <td>, it appears flush with the
> BOTTOM of the image..
>
> pls see http://www.mayacove.com/misc/table/table.html
>
> not sure how to solve this, "text-align:top" does not exist in css....;)
>

True because the property is called "vertical-align"

td { vertical-align: top; }
or
td { vertical-align: text-top; }

http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Posted by maya on February 15, 2008, 4:32 pm
Please log in for more thread options
Jonathan N. Little wrote:
> maya wrote:
>>
>> I have an image and right next to the image I have some text, all w/in
>> the same <td>.. but, even though I have valign="top" for the <td>, the
>> text does not appear on top of the <td>, it appears flush with the
>> BOTTOM of the image..
>>
>> pls see http://www.mayacove.com/misc/table/table.html
>>
>> not sure how to solve this, "text-align:top" does not exist in css....;)
>>
>
> True because the property is called "vertical-align"
>
> td { vertical-align: top; }
> or
> td { vertical-align: text-top; }
>
> http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align
>
>
>

thank you very much.. unfortunately neither one of these worked..
http://www.mayacove.com/misc/table/table.html

the only way text is where I want it is by eliminating the image.. (I
guess I need to do separate <td> for img and text, but I was trying to
avoid that..)

and yes, of course in the "real" site I will put all necessary
properties in img-tag (dimensions, border="0", fill in alt="", etc..
this at work, so of course will do these things..;) but for test-images
I relax a bit..;)
(this is all just "placeholders", as content will be inserted
dynamically thru a CMS..)

thank you very much..



Posted by Ben C on February 15, 2008, 5:43 pm
Please log in for more thread options
> Jonathan N. Little wrote:
>> maya wrote:
>>>
>>> I have an image and right next to the image I have some text, all w/in
>>> the same <td>.. but, even though I have valign="top" for the <td>, the
>>> text does not appear on top of the <td>, it appears flush with the
>>> BOTTOM of the image..
>>>
>>> pls see http://www.mayacove.com/misc/table/table.html
>>>
>>> not sure how to solve this, "text-align:top" does not exist in css....;)
>>>
>>
>> True because the property is called "vertical-align"
>>
>> td { vertical-align: top; }
>> or
>> td { vertical-align: text-top; }
>>
>> http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align
>>
>>
>>
>
> thank you very much.. unfortunately neither one of these worked..
> http://www.mayacove.com/misc/table/table.html
>
> the only way text is where I want it is by eliminating the image.. (I
> guess I need to do separate <td> for img and text, but I was trying to
> avoid that..)

You can set vertical-align: top on the <a> to bring it to the top of its
line-box (whose height in this case corresponds to that of the <img>).

.alignTop a { vertical-align: top }

Or just float the image as rf suggested.

Similar ThreadsPosted
Problem with table width? July 19, 2004, 10:45 pm
table percentage problem August 20, 2004, 10:11 am
Table widths problem October 6, 2004, 11:40 pm
Problem with TABLE WIDTH January 5, 2005, 6:53 pm
table alignment problem January 30, 2005, 10:48 pm
Problem with table 100% width June 8, 2005, 8:18 am
Problem With Button In Table September 2, 2005, 12:08 pm
Re: html table problem February 6, 2006, 5:59 pm
Table layout problem in Firefox/IE6 June 14, 2005, 8:42 am
Frontpage problem/ using css to center TABLE - help...! June 15, 2005, 1:05 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap