Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How to do this TD trick with CSS

Reply
Thread Tools

How to do this TD trick with CSS

 
 
Michael Laplante
Guest
Posts: n/a
 
      06-01-2006
One advantage of tables is that images and text in a TD will "stick"
together. New and unrelated text can be entered in a new row and it won't
back up into the image and text in the previous row, i.e.

<tr>
<td>
<left aligned image> Some text here.
</td>
</tr>
<tr>
<td>
I want this text either immediately below the image OR the text of the row
above depending on which one takes up more screen height.
</td>
</tr>

(Hope that makes sense.)

How do I accomplish the same thing with CSS?

I've tried the following:

<DIV>
<left aligned image> Some text here.
</DIV>
<DIV>
This text here appears immediately below the text in the div above and to
the right of the left-aligned image. Not what I want. . .
</DIV>

I also tried encasing the text and images within paragraph blocks within the
divs and that didn't work either.

M


 
Reply With Quote
 
 
 
 
dorayme
Guest
Posts: n/a
 
      06-01-2006
In article <94Jfg.6335$JX1.363@edtnps82>,
"Michael Laplante" <(E-Mail Removed)> wrote:

> One advantage of tables is that images and text in a TD will "stick"
> together. New and unrelated text can be entered in a new row and it won't
> back up into the image and text in the previous row, i.e.
>
> <tr>
> <td>
> <left aligned image> Some text here.
> </td>
> </tr>
> <tr>
> <td>
> I want this text either immediately below the image OR the text of the row
> above depending on which one takes up more screen height.
> </td>
> </tr>
>
> (Hope that makes sense.)
>
> How do I accomplish the same thing with CSS?
>
> I've tried the following:
>
> <DIV>
> <left aligned image> Some text here.
> </DIV>
> <DIV>
> This text here appears immediately below the text in the div above and to
> the right of the left-aligned image. Not what I want. . .
> </DIV>
>
> I also tried encasing the text and images within paragraph blocks within the
> divs and that didn't work either.
>
> M


You have the image floated left, the text will naturally go to
the right, you can control the situation with margins and
padding. There are complications but do it first and then mention
any problems you have.

--
dorayme
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Best css hack / trick to recommend? Kabuki Armadillo HTML 76 06-27-2008 07:47 PM
profile trick, really anoying Splibbilla Firefox 2 06-29-2005 08:39 PM
so... what's the trick in getting wireless working on Server 2003?! pif Wireless Networking 1 10-13-2004 04:21 PM



Advertisments