HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Positioning image and text within same cell w/o style sheet
Post new topic   Reply to topic    HTML Help Forum -> HTML Table
View previous topic :: View next topic  
Author Message
Light



Joined: 23 Oct 2009
Posts: 13
Location: Ozarks

PostPosted: Thu Nov 19, 2009 3:15 pm     Positioning image and text within same cell w/o style sheet Reply with quote

Hi, k back to my 2col 3row table. I want to put a image in 1st row that is colspan across both columns.
Then i want put content(text) next to it and for that text to not only flow from top of cell next to pic but also underneath the pick 3 or 4 lines. Align is depricated, valign doesnt work, float left doesn't work. So believe I have an alignment problem, but such a simple proble has got me baffled. Sad .
Maybe it's a position=absolute problem....don't know.

Code thus far;

<body>
<center>
<table border="15px" cellpadding="3px" bgcolor="#FF6600"/>
<td colspan="2" style="height: 225px" />
<img alt="red 1987 corvette" src= corvette.jpg"/>
<tr></tr>
<td style="width: 300px" height="170px" class="img1" </td>
<td style="width: 300px" height:170px></td>
<tr></tr>
<td style="width: 300px" height:170px></td>

<td style="width: 300px" height="170px"> </td>
</table>
</body>
sticks464



Joined: 31 Dec 2006
Posts: 2625

PostPosted: Thu Nov 19, 2009 4:06 pm     Reply with quote

You can't stick an image and text in the same cell without some type of styling to get what you want. By default elements will align top left unless otherwise styled. Since you don't want a stylesheet the alternative is inline styling.
Code:
<td colspan="2" style="height:225px; overflow:hidden;">
<p><img src="Group20Project/movies/images/corvette.jpg" alt="red corvette" width="" height="" style="float:left; margin:0 5px 5px 0;" />This is a red 1987 Corvette.</p>
</td>


You cannot use the self closing tag (/>) on table elements ie.
Code:
<td colspan="2" style="height: 225px" />


Used in xhtml documents only using an xhtml doctype for inline tags ie.
Code:
<img alt="red 1987 corvette" src= corvette.jpg" />
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> HTML Table All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial