Trying to center align button in td

David M. Karr picture David M. Karr · Mar 13, 2014 · Viewed 102.9k times · Source

I'm having trouble centering a button in a td.

This is probably a simple CSS issue, but the app is using bootstrap, AngularJS, AngularJS-ui-bootstrap, and ngTable. I've included all of these components in my plunkr.

I'm trying to set "horizontal-align: middle" on the td with the button, but that doesn't seem to get applied. The button still leans to the left side of the cell.

Answer

meriadec picture meriadec · Mar 13, 2014

You can use :

display: block;
margin: auto;

Here is your updated plunkr