singhnsk Posted March 30, 2011 Share Posted March 30, 2011 First of all, here's what i want it to look:' I just want that the related image must align towards left, and its information is just in front of it. :'( But, what my code does is place the image on above line, and the information on the link below. Here's how it looks with my code. I will be able to make the changes with the File Information. The PHP which is being used is: 1. To fetch if preview is available: $pre = ''; if ($prew==0) { if ($ext == 'bmp') $pre = 'Impossible Preview <br>'; if ($ext == 'gif' or $ext == 'jpeg' or $ext == 'jpg' or $ext == 'png' or $ext == 'JPG' or $ext == 'GIF' or $ext == 'PNG'or $ext == 'JPEG') $pre = '<img style="align:left;margin: 1px;" src="im.php?bab=1&id='.$file_info['id'].'" alt=""/>'; } 2. To insert the preview image: if($pre!=NULL) echo '<div class="block">'.$pre.'</div>'; 3. And finally the code to fetch file information: echo '<div class="fileName"><a href="load.php?id='.$file_info[id].'"><font color="red">'.$file_info['name'].''.$extension.'</font></a>|'; if($ext =='txt') { echo '<a href="read.php?id='.$file_info['id'].'&id2='.$id.'"><font color="red">Read</font></a>';} echo $new_info.''; if(!empty($file_info['fastabout'])) echo str_replace("\n", '<br>',$file_info['fastabout']); echo '</div>'; echo '<tr><div class="t_block">'.$ico.'<a href="view.php?id='.$file_info[id].'"><strong>File Info</strong></a></div></tr></td>'; I just can't figure out what to insert with the code. I think it must be some table formatting (TR/TD), but because I'm a noob with PHP, I failed in all my attempts. Please, if anyone could help me out! Link to comment https://forums.phpfreaks.com/topic/232145-unable-to-align-properly/ Share on other sites More sharing options...
gizmola Posted March 30, 2011 Share Posted March 30, 2011 With css the simple answer is to use a css style for the image that does: float: left; You should output the image first. Additional text will flow around the image. There's no need for tables, and I would avoid them for this. Link to comment https://forums.phpfreaks.com/topic/232145-unable-to-align-properly/#findComment-1194173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.