I'll-Be-Back I'll-Be-Back -4 years ago 231
CSS Question

Align Text Input to Right in td?

I am trying to align the Text Input to the right and for some reason it is not doing this.

I have used

style="text-align: right"

See example:



<table class="table">
<th>Field 1</th>
<th style="text-align:right">Field 1</th>
<td>Text 1</td>

<td style="text-align: right">
<div class="form-group" style="text-align: right">
<input style="width:60px" type="number" class="form-control" value="test">

Answer Source

No extra CSS is needed just use Bootstrap pull-right:


<div class="form-group">
          <input style="width:60px" type="number" class="form-control pull-right" value="test">

Updated fiddle

text-right won't work because the form-control is display: block

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download