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.

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

}

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

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

}
</style>
</head>
<body>

<?php

//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>';
?>
</body>
</html>

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>
<tr><td>
'.$row['profileimg'].'
</td></tr></table>
'.$row['username'].'</td></tr>';

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.