Hi all,
Can someone tell me,
How to wrap text around an image when the image source is in a php variable?Here is my code.

<style type="text/css">
#divider {
 background-color: #ccffff;
 border: 1px solid #ccc;
 padding: 0px;
 margin: 1px 0px 0px 0px;


position: absolute;
border: 2px solid #ccc;
 margin: 1px 0px 0px 0px;
top: 111px;
left: 220px;

 {   // I tried using float,align,valign but nothing worked.
    float: left; 



//database connections

echo '
<table width = "560"  class="fndslist" BGCOLOR="white" border="0" cellpadding="4" cellspacing="4">';
mysql_select_db ('db1');

$result = mysql_query("SELECT * FROM table1")or die(mysql_error());  

while($row = mysql_fetch_array( $result )) 
echo '<tr id="divider"><td>'.$row['profileimg'].$row['username'].'</td></tr>';


echo '</table>';

I have tried using valign,float,align but nothing is helping the text to wrap around the image. The text is simply getting displayed from the bottom-right corner of the image.
Can somebody help me resolve this issue.

Thanks in advance,

Recommended Answers

All 2 Replies

If alignment of the image wont work, why not make a barrier around the image. An example is

$imgwidth=64; //Image width
$imgheight=64; //Image height
echo '<tr id="divider"><td>
<table border=0 cellpadding=0 cellspacing=0 width=$imgwidth 
height=$imgheight align=left>

The above is just from the top of my head so don't be too suprised if there is a bug or 2.

commented: Genious +1

You are such a Genius it just worked very fine.

Thanks a Ton for it!!! Thankyou for your time :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.