问题描述:

does anyone know how to Inline an input and a div within a table cell?

this is the code:

<td>

<div class="input-group">

<input type="text" data-tier-id="1" class="form-control notes" value="2.829%">

<div class="input-group-addon">%</div>

</div>

</td>

网友答案:

This is very simple. Just add the following CSS code:

.form-control,.input-group-addon {
  display: inline;
  }
<td>
<div class="input-group">
    <input type="text" data-tier-id="1" class="form-control notes" value="2.829%">
    <div class="input-group-addon">%</div>
</div>
</td>
网友答案:

It seems that you are adding a title for the input, in which case I would recommend using a <label> tag instead of <div>.

<td>
<div class="input-group">
    <label><input type="text" data-tier-id="1" class="form-control notes" value="2.829%">%</label>
</div>
</td>

Otherwise..

CSS:

.form-control notes, .input-group-addon {
    display: inline-block;
}

HTML:

<td>
<div class="input-group">
    <input type="text" data-tier-id="1" class="form-control notes" value="2.829%">
    <div class="input-group-addon">%</div>
</div>
</td>
相关阅读:
Top