Jump to content

Placing Icon outside of table


Xtremer360

Recommended Posts

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

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..

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.