If you have a look at the following example, you can see that the input-group is below the button-group:
http://bootply.com/81723
I already tried putting both groups into floating divs, but the browsers still break the row. I noticed that ".btn-group, .btn-group-vertical" contain a "display: inline-block". After commenting this line out, the row doesn't break, but I don't have a space between both div (although I thought to get one by "padding-right: 16px")
How do you put two buttons on the same line? If you have multiple buttons that should sit side-by-side on the same line, add the data-inline="true" attribute to each button. This will style the buttons to be the width of their content and float the buttons so they sit on the same line.
You can use an out div with a class btn-group . This helps to align the buttons horizontally. Using col-md-6 for each button div can make the buttons missaligned with unwanted space in between.
Using input groups you can easily prepend and append text or buttons to the text-based inputs. For example, you can add the $ symbol, @ for a Twitter username, or anything else as required. Form groups are used to wrap labels and form controls in a div to get optimum spacing between the label and the control.
Instead of applying button sizing classes to every button in a group, just add .btn-group-* to each .btn-group , including each one when nesting multiple groups.
Found a working solution using table-display for containers:
<div class="Toolbar">
<div>
<div class="btn-group">
<button id="ButtonCreate" class="btn btn-default btn-sm" onclick="CreateItem()" title="Erstellen"><span class="glyphicon glyphicon-file"></span></button>
<button id="ButtonUpdate" class="btn btn-default btn-sm" onclick="UpdateItem()" title="Bearbeiten"><span class="glyphicon glyphicon-pencil"></span></button>
<button id="ButtonDelete" class="btn btn-default btn-sm" onclick="DeleteItems()" title="Löschen"><span class="glyphicon glyphicon-trash"></span></button>
<button id="ButtonExport" class="btn btn-default btn-sm" onclick="ExportItems()" title="Exportieren"><span class="glyphicon glyphicon-export"></span></button>
</div>
</div>
<div>
<div class="input-group input-group-sm">
<span class="input-group-btn"><button id="ButtonSearch" class="btn btn-default btn-sm" onclick="SearchItem()" title="Suchen"><span class="glyphicon glyphicon-search"></span></button></span>
<input type="text" class="form-control" style="width: 300px;" placeholder="Suchen">
</div>
</div>
</div>
CSS (LESS):
.Toolbar
{
position: relative;
display: table;
}
.Toolbar > div
{
display: table-cell;
padding-right: 8px;
vertical-align: top;
}
.Toolbar
{
.btn-group, .btn-group-vertical
{
vertical-align: inherit;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With