0
Look at the picture:
My system has those basic function buttons of a CRUD which are included in that part of the table through a <?php require("funcoes.php"); ?>
.
However, in doing the require
are appearing ("")
as seen by the Inspector of Elements and consequently is appearing a spacing that causes the contents of the included is shifted down, as in a line break.
You can tell me why by calling this one require
these quotes automatically enter by scrolling the content down?
File code included:
<?php require ('sessao.php'); ?>
<div class="btn-group">
<button class="btn btn-small btn-success tip editar" data-original-title="Ver e editar" name="editar" id="editar" value="<?=$fetch['id']; ?>">
<span class="icon-refresh icon-white"></span></button>
<button class="btn btn-small btn-warning tip" data-original-title="Arquivar" name="arquivar" id="arquivar" value="<?=$fetch['id']; ?>">
<span class="icon-folder-open icon-white"></span></button>
<button class="btn btn-small btn-danger tip" data-original-title="Excluir" name="excluir" id="excluir" value="<?=$fetch['id']; ?>">
<span class="icon-trash icon-white"></span></button>
</div>
<input type="hidden" name="identidade" value="<?=$fetch['id']; ?>" />
<input type="hidden" name="municipios" value="<?=$fetch['cod_cidades']; ?>" />
Most likely this space is in the required file. You can post it?
– Bruno Augusto
instead of require (which in addition to having the system reload the file for each row of the table, can include anything that is out of the <php tags), create a function that returns or prints the content with such buttons. and to find ghost spaces, use the "see source code" because in the element inspector the browser modifies all the code. helps also put temporary and different background-Cores on each element to identify easier which one exactly is dusting the space and generating the problem.
– Jader A. Wagner
Apparently it’s in the file
funcoes.php
how @Rodolfosilva replied, note that the quotes are before the tag<div class="btn-group">
.– Papa Charlie
I did request time tests to print some html content 30 times, using a function took between 0.00015 and 0.00020, and the same content using require also 30 times, took between 0.0095 to 0.0100... I found a considerable difference, Maybe in your current project nothing changes, but in an environment with many simultaneous requests can represent a good unnecessary load.
– Jader A. Wagner