Place icon in a cell of a table made with semantic-ui

2

I'm using Semantic-ui and on a page I load a table, which in the last two cells of each row, I put two icons that should behave as links to two other processes such as: edit the record, or delete it. Now ... according to the documentation of the semantic-ui people they say that each row of the table could be loaded in the following way:

   <tr>
     <td>Cell</td>
     <td>Cell</td>
     <td>Cell</td>
     <td>Cell</td>
     <td class="center aligned">
         <i class="eye icon"></i>
     </td>

     <td class="center aligned">
       <i class="delete icon"></i>
     </td>
   </tr>

Now, I implement each row as follows within a PHP while loop

<tbody>
      <?php while($row = $resultado->fetch_array(MYSQLI_ASSOC)) { ?>
        <tr>
          <td><?php echo $row['id']; ?></td>
          <td><?php echo $row['nombre']; ?></td>
          <td><?php echo $row['usuario']; ?></td>
          <td><?php echo $row['correo']; ?></td>
          <td><?php echo $row['last_session']; ?></td>
          <td class="center aligned">
            <i class="eye icon">
              <a href="modificar.php?id=<?php echo $row['id']; ?>"><p>Ver</p></a>
            </i>
          </td>

          <td class="center aligned">
            <i class="delete icon">
              <a href="eliminar.php?id=<?php echo $row['id']; ?>"><p>Borrar</p></a>
            </i>
          </td>
        </tr>
        <?php } ?>
    </tbody>

There I had to do a half-rare piece to put a "see" to have a link since I do not know how to make the icon become a "button" ... or last to place a button in that cell ... I do not know ... Can someone who has experience with semantic-ui give me a hand? from now many thanks!

See how it looks !!!: HORRIBLE !!!

    
asked by MNibor 29.06.2017 в 22:24
source

1 answer

1

How about putting the icons inside the links?

<tbody>
  <?php while($row = $resultado->fetch_array(MYSQLI_ASSOC)) { ?>
    <tr>
      <td><?php echo $row['id']; ?></td>
      <td><?php echo $row['nombre']; ?></td>
      <td><?php echo $row['usuario']; ?></td>
      <td><?php echo $row['correo']; ?></td>
      <td><?php echo $row['last_session']; ?></td>
      <td class="center aligned">
          <a href="modificar.php?id=<?php echo $row['id']; ?>">
            <i class="eye icon"></i>
          </a>
      </td>

      <td class="center aligned">
        <a href="eliminar.php?id=<?php echo $row['id']; ?>">            
          <i class="delete icon"></i>
        </a>
      </td>
    </tr>
    <?php } ?>
</tbody>
    
answered by 29.06.2017 / 22:33
source