text wrap around the image

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2008
Posts: 178
Reputation: sbv is an unknown quantity at this point 
Solved Threads: 8
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

text wrap around the image

 
0
  #1
Jan 17th, 2008
Hello friends
i want to display the data from database on page which contains the text and image. The problem is that i want to arrange those like the text should be wrapped around the Image.
Can it is possible?

Please help me if you have idea about this.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: text wrap around the image

 
0
  #2
Jan 17th, 2008
yes it is. it's a css style called float. this will have a weird effect on your image as text will be really close to it. I would suggest using this as the style property:
  1. style="padding-right:5px;padding-bottom:5px;float:left;"
that will keep the image on the left hand side with text wrapping around it. "float:right" will make it on the right hand side. If you want it on the right hand side, change padding-right to padding-left.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 178
Reputation: sbv is an unknown quantity at this point 
Solved Threads: 8
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Re: text wrap around the image

 
0
  #3
Jan 18th, 2008
Originally Posted by SheSaidImaPregy View Post
yes it is. it's a css style called float. this will have a weird effect on your image as text will be really close to it. I would suggest using this as the style property:
  1. style="padding-right:5px;padding-bottom:5px;float:left;"
that will keep the image on the left hand side with text wrapping around it. "float:right" will make it on the right hand side. If you want it on the right hand side, change padding-right to padding-left.


hi
thanks again for reply me. as i mentioned earlier my text value and image are coming from database. To show them on aspx page i need control. i used Text area for text in a <td> and in next <td> image.
as you suggest me i assigned the style tag to text area and make both img and text area in same <td>. But not get the result as want.
Then i also tried by directly witting text value (from database) in a Div and Style as you said. But again i am not getting what i want. i.e text warped around image. and also when i used Div it is not showing the indentations inputed. So.... i am still failed and searching the solution. Can you do something in this !!

Thanks for reply again.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: text wrap around the image

 
0
  #4
Jan 18th, 2008
you do not need a control for database info, so you know. Is it going to be in a repeater, datalist, etc? If so, then you don't need any additional controls. If not, then keep in mind of the formatting of how the controls work. This should work fine for you:
  1. <script ....>
  2. Sub .....
  3.  
  4. ltlPicture.Text = "<img src=""" & databaseresult & """ style=""padding-right:8px;padding-bottom:8px;float:left;"" alt=""""" />"
  5. ltlDescription.Text = databseoutput
  6.  
  7. End Sub
  8. </script>
  9.  
  10. <html>
  11. <body>
  12. <asp:Literal ID="ltlPicture" runat="server" />
  13. <asp:Literal ID="ltlDescription" runat="server" />
  14. </body>
  15. </html>
  16.  
Last edited by SheSaidImaPregy; Jan 18th, 2008 at 10:04 am.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 178
Reputation: sbv is an unknown quantity at this point 
Solved Threads: 8
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Re: text wrap around the image

 
0
  #5
Jan 19th, 2008
Originally Posted by SheSaidImaPregy View Post
you do not need a control for database info, so you know. Is it going to be in a repeater, datalist, etc? If so, then you don't need any additional controls. If not, then keep in mind of the formatting of how the controls work. This should work fine for you:
  1. <script ....>
  2. Sub .....
  3.  
  4. ltlPicture.Text = "<img src=""" & databaseresult & """ style=""padding-right:8px;padding-bottom:8px;float:left;"" alt=""""" />"
  5. ltlDescription.Text = databseoutput
  6.  
  7. End Sub
  8. </script>
  9.  
  10. <html>
  11. <body>
  12. <asp:Literal ID="ltlPicture" runat="server" />
  13. <asp:Literal ID="ltlDescription" runat="server" />
  14. </body>
  15. </html>
  16.  

---------------------------------------------------------------------------------
Hi!
thanks for reply. you are right. by setting style tag i am getting the result text wrap around the image. thanks. But still not exact.
What i get is as in this pic......
Attachment 4849
What i want is as in this pic......
Attachment 4850
i think now what exactly i am searching is clear. Thanks.. Have a good day.
(if unable to open images then plz find the attached zip files.)ZIP_IMG.zip
Last edited by sbv; Jan 19th, 2008 at 5:51 am.
Attached Thumbnails
WHAT I GET.JPG   WHAT I NEED.JPG  
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: text wrap around the image

 
0
  #6
Jan 19th, 2008
Okay, I need to see the code you are using, all HTML and Backend. The code I gave you should work, so it has to do with layout.
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 178
Reputation: sbv is an unknown quantity at this point 
Solved Threads: 8
sbv's Avatar
sbv sbv is offline Offline
Junior Poster

Re: text wrap around the image

 
0
  #7
Jan 21st, 2008
Hi,
GM.
Here is the HTML code.

<TR>
<td align="center">
<asp:Image id="imgTm" runat="server" width="200px" style="padding-right:8px;padding-bottom:8px;float:left;" ></asp:Image><TEXTAREA id="txtaTDtl" style="BORDER-RIGHT: gray 1px; BORDER-TOP: gray 1px; TEXT-JUSTIFY: newspaper; FONT-SIZE: 10pt; OVERFLOW: visible; BORDER-LEFT: gray 1px; TEXT-INDENT: 30pt; BORDER-BOTTOM: gray 1px; FONT-FAMILY: 'Century Gothic'; HEIGHT: 2000px; TEXT-ALIGN: justify" name="txtaTDtl" rows="51" cols="59" runat="server" readOnly wrap="hard"></TEXTAREA>
</TD>
</TR>
And nothing more than this.
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: text wrap around the image

 
0
  #8
Jan 21st, 2008
That's why, you have everything going into a text area. Does it have to be in a text area? I mean, is it going to be edited? If it isn't, remove the text area and insert the text into the page

Something like this would work well:
  1. <TR>
  2. <td align="center">
  3. <asp:Image id="imgTm" runat="server" width="200px" style="padding-right:8px;padding-bottom:8px;float:left;" /><asp:Literal ID="txtaTDtl" style="BORDER-RIGHT: gray 1px; BORDER-TOP: gray 1px; TEXT-JUSTIFY: newspaper; FONT-SIZE: 10pt; OVERFLOW: visible; BORDER-LEFT: gray 1px; TEXT-INDENT: 30pt; BORDER-BOTTOM: gray 1px; FONT-FAMILY: 'Century Gothic'; HEIGHT: 2000px; TEXT-ALIGN: justify" name="txtaTDtl" runat="server" wrap="hard" />
  4. </TD>
  5. </TR>
You have to refrain from the fields, and divs unless your image is inside the div. And if you look at the end of the tags, they end with "/>" which tells the server that the tag ends there. ending your tags with "/>" is the same as "></asp:Image>".
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC