spaces to the right when passing data to input text in modal

0

This is my case I hope you can help me

I have a table which is filled with data from mysql, each row has a button that displays a modal window which carries the data of the row on which the button was clicked. Everything works fine except that it leaves me a considerable number of blank spaces to the left of the data it carries and I do not know how to remove them, try using trim to remove them but I can not get it.

This is the way I fill the table

<table class="table table-striped" id="info-tabla">
                        <thead>
                            <th style="width:80px;">Nombre</th>
                            <th style="width:40px;">Rol</th>
                            <th style="width:60px;">Correo</th>
                            <th style="width:60px;">visualizar</th>
                          
                        </thead>
                        <tbody>
                            <?php foreach($consulta as $info): ?>
                            <tr>
                                <td><span id="alias<?php echo $info->getID();?>">
                                        <?php echo $info->getNombre(); ?></span>
                                </td>
                                <td>
                                    <?php echo $info->getRoles(); ?>
                                </td>
                                <td>
                                    <?php echo $info->getCorreo(); ?>
                                </td>
                                <td><button type="button" class="btn btn-danger btn-sm  Mostrar" value="<?php echo $info->getID(); ?>"><span>Visualizar</span></button>
                                </td>
                               
                            </tr>
                            <?php 
                        endforeach;
                        ?>
                        </tbody>
                    </table>

<div class="modal fade bd-example-modal-sm" id="mostrar" name="mostrar" tabindex="-1" role="dialog" aria-labelledby="mostrar" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <h6 class="modal-title">Esta viendo:</h6>
                <button class="close" data-dismiss="modal" aria-label="Cerrar">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="container-fluid">
                    <div class="col-12">
                        <form action="" method="post" class="form-group ">
                            <input type="text" class="form-control crea_data" id="alias" name="alias">
                            <input type="submit" value="Confirmar" id="confirmar" name="confirmar" class="mt-4 btn btn-danger btn-sm btn-guardar">
                        </form>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

As you can see leaves spaces to the left of the data that should show

Thank you in advance for the help

    
asked by car-onte 04.10.2018 в 16:28
source

1 answer

1

The error may be because you are leaving space between

<span id="alias<?php echo $info->getID();?>">

and

echo $info->getNombre(); ?>

Modify it side by side, without leaving any kind of space, line break or anything.

    
answered by 22.10.2018 / 15:17
source