Xtremer360 Posted August 7, 2011 Share Posted August 7, 2011 I'm trying to figure out why its displaying the file_open icon OUTSIDE of the table. <?php while ($row = mysqli_fetch_array($menuStructuresResult, MYSQLI_ASSOC)) { $menuStructures .= "<tr>"; $menuStructures .= "<td><input type=\"checkbox\" name=\"menuStructures\" value=\"".$row['id']."\"/></td>"; $menuStructures .= "<td>".$row['id']."</td>"; $menuStructures .= "<td>".$row['menuName']."</td>"; $menuStructures .= "<td>".$row['shortName']."</td>"; $menuStructures .= "<td>"; if ($row['multiLevel'] == 'Yes'){ echo "<a href=\"#\"><img src=\"".$managerURL."images/file_open.png\" class=\"menuCateggories\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['id']."\" /></a>"; } $menuStructures .= "</td>"; $menuStructures .= "<td>"; if ($row['multiLevel'] == 'No'){ echo "<a href=\"#\"><img src=\"".$managerURL."images/link.png\" class=\"menuLinks\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['id']."\" /></a>"; } $menuStructures .= "</td>"; $menuStructures .= "<td><a href=\"#\"><img src=\"".$managerURL."images/user_edit.png\" class=\"edit\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['id']."\" /></a></td>"; $menuStructures .= "<td>"; $menuStructures .= "<a href=\"#\" class=\"ask\"><img src=\"".$managerURL."images/trash.png\" class=\"delete\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['id']."\" /></a>"; $menuStructures .= "</td>"; $menuStructures .= "</tr>"; } ?> Link to comment https://forums.phpfreaks.com/topic/244077-placing-icon-outside-of-table/ Share on other sites More sharing options...
AyKay47 Posted August 7, 2011 Share Posted August 7, 2011 glancing at the code im not really sure as nothing jumps out at me as being incorrect..what does a view source in your browser show the HTML doing? Link to comment https://forums.phpfreaks.com/topic/244077-placing-icon-outside-of-table/#findComment-1253524 Share on other sites More sharing options...
Xtremer360 Posted August 7, 2011 Author Share Posted August 7, 2011 It shows: <a href="#"><img src="http://www.kansasoutlawwrestling.com/manager/images/file_open.png" class="menuCateggories" alt="" title="" border="0" id="1" /></a> At the very top of the view source. Link to comment https://forums.phpfreaks.com/topic/244077-placing-icon-outside-of-table/#findComment-1253525 Share on other sites More sharing options...
Xtremer360 Posted August 7, 2011 Author Share Posted August 7, 2011 http://jsfiddle.net/SuaEL/ Link to comment https://forums.phpfreaks.com/topic/244077-placing-icon-outside-of-table/#findComment-1253528 Share on other sites More sharing options...
AyKay47 Posted August 7, 2011 Share Posted August 7, 2011 this is most likely because the $menuStructures variable is getting output later than the echo...try this $menuStructures .= "<td>"; if ($row['multiLevel'] == 'Yes'){ $menuStructures .= "<a href=\"#\"><img src=\"".$managerURL."images/file_open.png\" class=\"menuCateggories\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['id']."\" /></a>"; } $menuStructures .= "</td>"; same goes for the other one, instead of outputting the links...you need to concatenate them onto your variable for output.. Link to comment https://forums.phpfreaks.com/topic/244077-placing-icon-outside-of-table/#findComment-1253531 Share on other sites More sharing options...
Xtremer360 Posted August 7, 2011 Author Share Posted August 7, 2011 That was the problem. Link to comment https://forums.phpfreaks.com/topic/244077-placing-icon-outside-of-table/#findComment-1253533 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.