Bootstrap button side by side in table [duplicate] - html

This question already has answers here:
Make 2 buttons inside a table cell be next to each other
(5 answers)
Closed 6 years ago.
I have a problem to make the button in table side by side. I have tried table-responsive but it didn't work. I really hope that you can help me.
Here is my code. Based on my understanding, table-responsive or table table-bordered table-hover is from Bootstrap. As long I link it in my index.html, supposedly it should be fine.
But now my output is not as I desired. The button that I have circle should be side by side
P/S: sorry for my english.
<div class=" table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>PPMID</th>
<th>EPRID</th>
<th>Release ID</th>
<th>Project Name</th>
<th>Release Name</th>
<th>Application Name</th>
<th>Action</th>
</tr>
<tr>
<th>
<input class="form-control" id="ppmid" type="number" min="1" placeholder="PPMID">
</th>
<th>
<input class="form-control" id="eprid" type="number" min="1" placeholder="EPRID">
</th>
<th>
<input class="form-control" id="releaseid" type="text" placeholder="Release ID">
</th>
<th>
<input class="form-control" id="projectname" type="text" placeholder="Project Name">
</th>
<th>
<input class="form-control" id="releasename" type="text" placeholder="Release Name">
</th>
<th>
<input class="form-control" id="applicationname" type="text" placeholder="Application Name">
</th>
<th>
<button class="btn btn-primary">
<span class="glyphicon glyphicon-plus"></span>
</button>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in filteredlist | filter:searchText"><!--false for ascending, true for descnding-->
<td>{{item.PMID}}</td>
<td>{{item.EPRID}}</td>
<td>{{item.Releaseid}}</td>
<td>{{item.projectname}}</td>
<td>{{item.releasename}}</td>
<td>{{item.appname}}</td>
<td>
<button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-edit"></span>
</button>
<button type="button" class="btn btn-danger">
<span class="glyphicon glyphicon-trash"></span>
</button>
</td>
</tr>
</tbody>
</table>
</div>

There is no problem with your code. It works just fine. Button side by side
Maybe you should try checking if your browser is not in a zoom-in mode or check if the resolution is correct.
Live Demo Here
Snippet Example
/* Latest compiled and minified CSS included as External Resource*/
/* Optional theme */
#import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
body {
margin: 10px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<div class=" table-responsive">
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>PPMID</th>
<th>EPRID</th>
<th>Release ID</th>
<th>Project Name</th>
<th>Release Name</th>
<th>Application Name</th>
<th>Action</th>
</tr>
<tr>
<th>
<input class="form-control" id="ppmid" type="number" min="1" placeholder="PPMID">
</th>
<th>
<input class="form-control" id="eprid" type="number" min="1" placeholder="EPRID">
</th>
<th>
<input class="form-control" id="releaseid" type="text" placeholder="Release ID">
</th>
<th>
<input class="form-control" id="projectname" type="text" placeholder="Project Name">
</th>
<th>
<input class="form-control" id="releasename" type="text" placeholder="Release Name">
</th>
<th>
<input class="form-control" id="applicationname" type="text" placeholder="Application Name">
</th>
<th>
<button class="btn btn-primary">
<span class="glyphicon glyphicon-plus"></span>
</button>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in filteredlist | filter:searchText"><!--false for ascending, true for descnding-->
<td>{{item.PMID}}</td>
<td>{{item.EPRID}}</td>
<td>{{item.Releaseid}}</td>
<td>{{item.projectname}}</td>
<td>{{item.releasename}}</td>
<td>{{item.appname}}</td>
<td>
<button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-edit"></span>
</button>
<button type="button" class="btn btn-danger">
<span class="glyphicon glyphicon-trash"></span>
</button>
</td>
</tr>
</tbody>
</table>
</div>

I think <td> do not have enough width for the buttons make them side-by-side.
Two solutions:
.side-by-side {
display: -webkit-flex;
display: flex;
flex-wrap: nowrap; // force buttons not line-break
}
add this CSS for the container <td>.
(btw, flex is CSS3 property, check browser support here)
or give enough fixed width for the <td>.

Related

How to fix htmlspecialchars() expects parameter 1 to be string, array given

I am follwing this bootsnip code in https://bootsnipp.com/snippets/BE93p
for creating a dynamic table in bootstrab, it insert a new filed after clicking add row button and dynamically calculate the total price after filling the inputs.
but I git this error after inserting a new row?!
htmlspecialchars() expects parameter 1 to be string, array given (View: C:\xampp\htdocs\laundry\vendor\blade-ui-kit\blade-ui-kit\resources\views\components\forms\inputs\input.blade.php)
the Blade page:
<div class="container">
<div class="row clearfix">
<div class="col-md-12">
<table class="table table-bordered table-hover" id="tab_logic">
<thead>
<tr>
<th class="text-center"> # </th>
<th class="text-center"> Product </th>
<th class="text-center"> Qty </th>
<th class="text-center"> Price </th>
<th class="text-center"> Total </th>
</tr>
</thead>
<tbody>
<tr id='addr0'>
<td>1</td>
<td><input type="text" name='product[]' placeholder='Enter Product Name' class="form-control"/></td>
<td><input type="number" name='qty[]' placeholder='Enter Qty' class="form-control qty" step="0" min="0"/></td>
<td><input type="number" name='price[]' placeholder='Enter Unit Price' class="form-control price" step="0.00" min="0"/></td>
<td><input type="number" name='total[]' placeholder='0.00' class="form-control total" readonly/></td>
</tr>
<tr id='addr1'></tr>
</tbody>
</table>
</div>
</div>
<div class="row clearfix">
<div class="col-md-12">
<button id="add_row" class="btn btn-default pull-left">Add Row</button>
<button id='delete_row' class="pull-right btn btn-default">Delete Row</button>
</div>
</div>
<div class="row clearfix" style="margin-top:20px">
<div class="pull-right col-md-4">
<table class="table table-bordered table-hover" id="tab_logic_total">
<tbody>
<tr>
<th class="text-center">Sub Total</th>
<td class="text-center"><input type="number" name='sub_total' placeholder='0.00' class="form-control" id="sub_total" readonly/></td>
</tr>
<tr>
<th class="text-center">Tax</th>
<td class="text-center"><div class="input-group mb-2 mb-sm-0">
<input type="number" class="form-control" id="tax" placeholder="0">
<div class="input-group-addon">%</div>
</div></td>
</tr>
<tr>
<th class="text-center">Tax Amount</th>
<td class="text-center"><input type="number" name='tax_amount' id="tax_amount" placeholder='0.00' class="form-control" readonly/></td>
</tr>
<tr>
<th class="text-center">Grand Total</th>
<td class="text-center"><input type="number" name='total_amount' id="total_amount" placeholder='0.00' class="form-control" readonly/></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script>
$(document).ready(function(){
var i=1;
$("#add_row").click(function(){b=i-1;
$('#addr'+i).html($('#addr'+b).html()).find('td:first-child').html(i+1);
$('#tab_logic').append('<tr id="addr'+(i+1)+'"></tr>');
i++;
});
$("#delete_row").click(function(){
if(i>1){
$("#addr"+(i-1)).html('');
i--;
}
calc();
});
$('#tab_logic tbody').on('keyup change',function(){
calc();
});
$('#tax').on('keyup change',function(){
calc_total();
});
});
function calc()
{
$('#tab_logic tbody tr').each(function(i, element) {
var html = $(this).html();
if(html!='')
{
var qty = $(this).find('.qty').val();
var price = $(this).find('.price').val();
$(this).find('.total').val(qty*price);
calc_total();
}
});
}
function calc_total()
{
total=0;
$('.total').each(function() {
total += parseInt($(this).val());
});
$('#sub_total').val(total.toFixed(2));
tax_sum=total/100*$('#tax').val();
$('#tax_amount').val(tax_sum.toFixed(2));
$('#total_amount').val((tax_sum+total).toFixed(2));
}
please help me to fix that error
Had fixed this issue simmply by adding type="button"
in the button tags
<button type="button" id="add_row" class="btn btn-default pull-left">Add Row</button>
<button type="button" id='delete_row' class="pull-right btn btn-default">Delete Row</button>

Styling an invoice form using Bootstrap 4

In my VueJS application I am building an invoice form using Bootstrap 4, I am using this code snippet and everything has been great so far but the problem is that, when it comes to styling a UI I kind of suck at the moment :)
The problem here is that the bottom totals part is floating to the left instead of to the right. This code snippet has been taken from a Bootstrap 3 code snippet samples and I am using Bootstrap 4 so probably this is the issue. However, I've tried converting it to Bootstrap 4 using online converters but none of them helped me. I would appreciate your help.
This is the code that I want to float to the right.
<div class="row clearfix" style="margin-top:20px">
<div class="float-right col-lg-4">
<table class="table table-bordered table-hover" id="tab_logic_total">
<tbody>
<tr>
<th class="text-center">Sub Total</th>
<td class="text-center">
<input type="number" name="sub_total" placeholder="0.00" class="form-control" id="sub_total" readonly>
</td>
</tr>
<tr>
<th class="text-center">Tax</th>
<td class="text-center">
<div class="input-group mb-2 mb-sm-0">
<input type="number" class="form-control" id="tax" placeholder="0">
<div class="input-group-addon">%</div>
</div>
</td>
</tr>
<tr>
<th class="text-center">Tax Amount</th>
<td class="text-center">
<input type="number" name="tax_amount" id="tax_amount" placeholder="0.00" class="form-control" readonly>
</td>
</tr>
<tr>
<th class="text-center">Grand Total</th>
<td class="text-center">
<input type="number" name="total_amount" id="total_amount" placeholder="0.00" class="form-control" readonly>
</td>
</tr>
</tbody>
</table>
</div>
</div>
You could use offset for responsively offsetting the columns. Since the container of #tab_logic_total table is taking up 4 columns, we have 8 left, so:
<div class="row clearfix" style="margin-top:20px">
<!-- Notice this line: We are offsetting the table by 8 columns -->
<div class="col-lg-4 offset-lg-8">
<table class="table table-bordered table-hover" id="tab_logic_total">
<tbody>
<tr>
<th class="text-center">Sub Total</th>
<td class="text-center">
At this point, we no longer need the float-right class. It won't have any effect on flexbox anyway.
Further readings:
Bootstrap Grid system

Bootstrap columns/grid sizing issue

I have a Bootstrap page showing a title with 2 forms in a single row above a table. The 2nd form with the 2 inputs which appears in the top left above the table is taking up the full width of the parent column (col-md-8) - it only needs to take up around half of this column width.
I can't work out how to position this so it takes up less space but still aligns with the left of the title/table at the same time. Here's how it currently looks (make sure your use the full page option to see this as it will be used on desktop only):
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="col-md-8">
<h1>Items List</h1>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<form class="form-horizontal" id="findItems" action="#" method="get" role="form">
<input type="hidden" name="action" value="findItems">
<table class="table table-bordered">
<tr>
<td><input type="text" class="form-control" name="itemID" id="itemID" placeholder="Shipment ID"></td>
<td><input type="text" class="form-control datepicker" name="shippingDate" id="shippingDate" data-date-format="dd/mm/yyyy" placeholder="Date Shipped"></td>
<td class="text-center">
<button type="submit" class="btn btn-success">Update All</button>
</td>
</tr>
</table>
</form>
</div>
<!-- /.col-md-8-->
<div class="col-md-4">
<div>
<form class="form-horizontal" id="findMoreItems" action="#" method="get" role="form">
<input type="hidden" name="action" value="findMoreItems">
<table class="table table-bordered">
<tr>
<td>Shipment ID:</td>
<td><input type="text" class="form-control" name="shipmentID" id="shipmentID" placeholder="Shipment ID"></td>
</tr>
<tr>
<td>Authority ID:</td>
<td><input type="text" class="form-control" name="authorityID" id="authorityID" placeholder="Authority ID"></td>
</tr>
<tr>
<td>Ref ID:</td>
<td><input type="text" class="form-control" name="refID" id="refID" placeholder="Ref ID"></td>
</tr>
<tr>
<td>Serial Number:</td>
<td><input type="text" class="form-control" name="serialNumber" id="serialNumber" placeholder="Serial #"></td>
</tr>
<tr>
<td colspan="2" class="text-center">
<button type="reset" class="btn btn-default">Reset</button>
<button type="submit" class="btn btn-success">Search</button>
</td>
</tr>
</table>
</form>
</div>
</div>
<!-- /.col-md-4-->
</div>
<!-- /.row-->
<br>
<div>
<br />
<table class="table table-condensed table-striped table-bordered">
<thead>
<th class="text-center" scope="col">Shipment ID</th>
<th class="text-center" scope="col">Item ID</th>
<th class="text-center" scope="col">Serial Number</th>
<th class="text-center" scope="col">Shipped Date</th>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><!-- /.container -->
You could always just add a spacer column. So...
<div class="col-md-6"> two table things </div>
<div class="col-md-2"> empty column for spacing </div>
<div class="col-md-4"> other table </div>

Table columns changing size when hiding/showing row

Sorry for the title, I don't really know how to better phrase my question, but here is a more detailed description:
I have a table that has a bunch of rows that is used to keep track of tasks in a todo list sense, and the rows themselves can be clicked on to show a table embedded within one of their columns to keep track of sub-tasks. When I click on one of the tasks to show the subtasks, the width of the column changes. I have the following demonstration:
If you look closely at the first row and the table header, the colum width is changing. I checked this with inspector and it appears for "test shift input" it changes only 1px, whereas for "test shift input and button" the change is more drastic.
The relevant demo is here. And the code will be posted below. I want to know:
Why this happens - I suspect it is width related from the subtasks table? But please correct me if I'm mistaken.
How to fix this, keeping as much of the current structure as possible. I could probably rewrite the whole thing using divs instead of table but it would be nice to not have to do that.
Thanks in advance.
The HTML:
<div>
<table class="table">
<thead>
<tr>
<th><i class="glyphicon glyphicon-check"></i></th>
<th>Task</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td width="10%">
<input type="checkbox" ng-model="item.checked" class="ng-pristine ng-untouched ng-valid">
</td>
<td width="90%">
<input class="form-control ng-pristine ng-untouched ng-valid" ng-model="item.name">
</td>
<td>
<button class="btn btn-primary btn-responsive" ng-click="addItem()"><i class="glyphicon glyphicon-plus"></i></button>
</td>
</tr>
<tr>
<td colspan="3" style="padding:0">
<div class="dataTableContainer" style="height:460px;overflow:auto">
<table class="table">
<tbody>
<tr ng-repeat="thisTodo in todoList track by $index" class="ng-scope">
<td width="10%">
<input type="checkbox" ng-model="thisTodo.checked" ng-click="checked(thisTodo._id,thisTodo.checked)" class="ng-pristine ng-untouched ng-valid">
</td>
<td width="90%">
<div for="0" class="checked-false" onclick="$('#test1').toggle()">
Test shift input and button
</div>
<table id="test1" class="table">
<thead>
<tr>
<th width="10%"><i class="glyphicon glyphicon-check"></i></th>
<th>Subtask</th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>
<input type="checkbox" ng-model="thisTodo.subItem.checked" class="ng-pristine ng-untouched ng-valid">
</td>
<td>
<input class="form-control ng-valid ng-dirty ng-touched" ng-model="thisTodo.subItem.name">
</td>
<td>
<button class="btn btn-primary btn-responsive" ng-click="addSubItem(thisTodo)"><i class="glyphicon glyphicon-plus"></i></button>
</td>
</tr>
<!-- ngRepeat: subtask in thisTodo.subtasks --><tr ng-repeat="subtask in thisTodo.subtasks" class="ng-scope">
<td>
<input type="checkbox" ng-model="subtask.checked" ng-click="checkedSubtask(thisTodo._id,subtask._id,subtask.checked)" class="ng-pristine ng-untouched ng-valid">
</td>
<td>
<div class="checked-false">
Test
</div>
</td>
<td>
<button class="btn btn-danger btn-responsive" ng-click="removeSubItem(thisTodo._id,subtask._id)"><i class="glyphicon glyphicon-trash"></i></button>
</td>
</tr><!-- end ngRepeat: subtask in thisTodo.subtasks --><tr ng-repeat="subtask in thisTodo.subtasks" class="ng-scope">
<td>
<input type="checkbox" ng-model="subtask.checked" ng-click="checkedSubtask(thisTodo._id,subtask._id,subtask.checked)" class="ng-pristine ng-untouched ng-valid">
</td>
<td>
<div class="checked-false">
loalsdfjalskdjfalkjfaasdf
</div>
</td>
<td>
<button class="btn btn-danger btn-responsive" ng-click="removeSubItem(thisTodo._id,subtask._id)"><i class="glyphicon glyphicon-trash"></i></button>
</td>
</tr><!-- end ngRepeat: subtask in thisTodo.subtasks -->
</tbody></table>
</td>
<td>
<button class="btn btn-danger btn-responsive" ng-click="remove(thisTodo._id)"><i class="glyphicon glyphicon-trash"></i></button>
</td>
</tr><tr ng-repeat="thisTodo in todoList track by $index" class="ng-scope">
<td width="10%">
<input type="checkbox" ng-model="thisTodo.checked" ng-click="checked(thisTodo._id,thisTodo.checked)" class="ng-pristine ng-untouched ng-valid">
</td>
<td width="90%">
<div for="1" class="checked-false" onclick="$('#test2').toggle()">
Test shift input
</div>
<table id="test2" class="table">
<thead>
<tr>
<th width="10%"><i class="glyphicon glyphicon-check"></i></th>
<th>Subtask</th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>
<input type="checkbox" ng-model="thisTodo.subItem.checked" class="ng-pristine ng-untouched ng-valid">
</td>
<td>
<input class="form-control ng-pristine ng-valid ng-touched" ng-model="thisTodo.subItem.name">
</td>
<td>
<button class="btn btn-primary btn-responsive" ng-click="addSubItem(thisTodo)"><i class="glyphicon glyphicon-plus"></i></button>
</td>
</tr>
<!-- ngRepeat: subtask in thisTodo.subtasks -->
</tbody></table>
</td>
<td>
<button class="btn btn-danger btn-responsive" ng-click="remove(thisTodo._id)"><i class="glyphicon glyphicon-trash"></i></button>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
The CSS:
.table{
width:100%;
table-layout: inherit;
}
.checked-false {
color: black;
background-color: rgba(255, 255, 0, 0.25);
border-radius: 10px;
margin: 5px
}
#test1, #test2 {
display:none;
}
I guess its problem with your td %
You have mentioned table 100% out of that 1st td is 10% and second td is of 90% now what about third td % it will be extra right?
So check your td % and try to match with total %.
I distribute 100% in 10% + 80% + 10%
<tr>
<td width="10%">
<input type="checkbox" ng-model="item.checked" class="ng-pristine ng-untouched ng-valid">
</td>
<td width="80%">
<input class="form-control ng-pristine ng-untouched ng-valid" ng-model="item.name">
</td>
<td>
<button class="btn btn-primary btn-responsive" ng-click="addItem()"><i class="glyphicon glyphicon-plus"></i></button>
</td>
</tr>
here is an updated sample.
https://jsfiddle.net/ccrwj998/1/
You just need to reduce the width of the 2nd <td> element with 90% width and assign width to the 3rd <td element> so that the total width of the three <td> elements sum up to 100%;
Here is the updated fiddle. I have set the width here to 5% for the 3rd <td> element, but you should set it equal to the width of the button.
<tr>
<td width="10%">
<input type="checkbox" ng-model="item.checked" class="ng-pristine ng-untouched ng-valid">
</td>
<td width="85%">
<input class="form-control ng-pristine ng-untouched ng-valid" ng-model="item.name">
</td>
<td width="5%">
<button class="btn btn-primary btn-responsive" ng-click="addItem()"><i class="glyphicon glyphicon-plus"></i></button>
</td>
</tr>

Table with two tbody's next to each other in table, thead on top

I want to create an HTML table that looks like this:
Left context | Right context | Delete row?
-------------------------------------------
1 [input] [input] Y/N
2 [input] [input] Y/N
3 [input] [input] Y/N
This seems simple enough. The thing is that I want to make the rows sortable with jQuery UI. That's easy enough as well (call .sortable() on the tbody), however I find this very ugly because the number moves with the row. What I want is that only the "real" rows move, without the indices (1, 2, 3 and so on). Those numbers should always be in the same spot, but the rows can move around.
I thought I could simply make a new tbody inside the table, after the thead, which would only contain the numbers, and then call .sortable on the tbody that contains only the rows. However, obviously this doesn't work: the tables don't float next to each other, but are placed above each other.
Any ideas how to deal with this? Test case on JSFiddle:
<table class="table table-hover table-striped">
<thead>
<tr>
<th></th>
<th>Left context</th>
<th>Right context</th>
<th class="text-center">Delete row?</th>
</tr>
</thead>
<tbody>
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
<tr><td>5</td></tr>
<tr><td>6</td></tr>
</tbody>
<tbody class="sortable">
<tr class="ui-state-default">
<td>
<input type="text" class="form-control left-context" value="">
</td>
<td>
<input type="text" class="form-control right-context" value="">
</td>
<td>
<button type="button" class="btn btn-danger remove-row"><i class="fa fa-trash-o"></i>
</button>
</td>
</tr>
<tr class="ui-state-default">
<td>
<input type="text" class="form-control left-context" value="">
</td>
<td>
<input type="text" class="form-control right-context" value="">
</td>
<td>
<button type="button" class="btn btn-danger remove-row"><i class="fa fa-trash-o"></i>
</button>
</td>
</tr>
<tr class="ui-state-default">
<td>
<input type="text" class="form-control left-context" value="">
</td>
<td>
<input type="text" class="form-control right-context" value="">
</td>
<td>
<button type="button" class="btn btn-danger remove-row"><i class="fa fa-trash-o"></i>
</button>
</td>
</tr>
<tr class="ui-state-default">
<td>
<input type="text" class="form-control left-context" value="">
</td>
<td>
<input type="text" class="form-control right-context" value="">
</td>
<td>
<button type="button" class="btn btn-danger remove-row"><i class="fa fa-trash-o"></i>
</button>
</td>
</tr>
<tr class="ui-state-default">
<td>
<input type="text" class="form-control left-context" value="">
</td>
<td>
<input type="text" class="form-control right-context" value="">
</td>
<td>
<button type="button" class="btn btn-danger remove-row"><i class="fa fa-trash-o"></i>
</button>
</td>
</tr>
<tr class="ui-state-default">
<td>
<input type="text" class="form-control left-context" value="">
</td>
<td>
<input type="text" class="form-control right-context" value="">
</td>
<td>
<button type="button" class="btn btn-danger remove-row"><i class="fa fa-trash-o"></i>
</button>
</td>
</tr>
</tbody>
</table>
I suggest using CSS counters in pseudo-elements displayed as table-cells:
$("tbody").sortable();
$("button").on("click", function () {
$(this).closest("tr").fadeOut(300);
});
#import 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css';
td {
padding: 8px;
}
thead > tr:before {
content: '';
display: table-cell;
}
tbody {
counter-reset: row-number;
}
tbody > tr:before {
counter-increment: row-number;
content: counter(row-number);
display: table-cell;
vertical-align: middle;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<table class="table table-hover table-striped">
<thead>
<tr>
<th>Left context</th>
<th>Right context</th>
<th>Delete row?</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="text"></td>
<td><input type="text"></td>
<td><button type="button"><i class="fa fa-trash-o"></i></button></td>
</tr>
<tr>
<td><input type="text"></td>
<td><input type="text"></td>
<td><button type="button"><i class="fa fa-trash-o"></i></button></td>
</tr>
<tr>
<td><input type="text"></td>
<td><input type="text"></td>
<td><button type="button"><i class="fa fa-trash-o"></i></button></td>
</tr>
<tr>
<td><input type="text"></td>
<td><input type="text"></td>
<td><button type="button"><i class="fa fa-trash-o"></i></button></td>
</tr>
<tr>
<td><input type="text"></td>
<td><input type="text"></td>
<td><button type="button"><i class="fa fa-trash-o"></i></button></td>
</tr>
<tr>
<td><input type="text"></td>
<td><input type="text"></td>
<td><button type="button"><i class="fa fa-trash-o"></i></button></td>
</tr>
</tbody>
</table>