I am using bootstrap 3. In a modal window I have an inline form and below it is a table. But the left margin of the form is not the same as the table or window title. How can I correct that?
<section class="main container">
<div class="modal fade" id="ventana">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-tittle">Consulta Cliente</h4>
</div>
<div class="modal-body">
<div class="row">
<form action="accion.php" class="form-inline">
<div class="form-group">
<div>
<label for="Stud">Nombre Cliente:</label>
<input class="form-control" id="cliente" type="text" placeholder="Cliente a buscar">
</div>
</div>
<div class="form-group">
<div>
<button class="btn btn-primary">Aceptar</button>
</div>
</div>
</form>
</div>
<div class="row">
<div class="col-md-12">
<h3>Cuentas Corrientes</h3>
<table class="table table-condensed table-bordered table-hover">
<tr class="success">
<th>Fecha</th>
<th>Período</th>
<th>Glosa</th>
<th>Doc.</th>
<th>Cant.</th>
<th>Importe</th>
<th>Saldo</th>
<th> </th>
</tr>
<tr>
<td>12/05/2016</td>
<td>201610</td>
<td>Cobranza Diciembre 2017</td>
<td>Rep.Sup.Enero 2017</td>
<td>65</td>
<td>280.00</td>
<td>280.00</td>
<td>+</td>
</tr>
</tr>
</table>
</div>
</div>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
</section>
You have to put the
form
inside adiv
with the classcol-md-12
like this:Your form is inside an element
<div>
with class.row
, but this element needs another element<div>
with the column layout you want to put.In order for it to have the same margin, it is enough that a column class is added to the element
<div>
nested inside the element<div>
with the class.row
. In this case, I add the same columning class that the table has,.col-md-12
.Here you can see it in action. To the code I added a button to activate the modal:
Other options are to add the "col-xs-12" directly to the form: Example