Bootstrap3在表格前面添加一个图标

时间:2015-12-01 04:24:13

标签: html twitter-bootstrap html-table icons

我正在尝试在桌面前添加一个图标。

<div class="row">
<div class="col-xs-offset-8 col-xs-4">
    <span class="fa fa-pencil pull-left"></span>
    <table class="table table-condensed table-bordered">
        <thead>
            <th class="text-center">Date</th>
        </thead>
        <tbody>
            <tr>
                <td class="text-center">01/01/2015</td>
            </tr>
        </tbody>
    </table>
</div>

我需要在桌子左边用铅笔和#34;日期&#34; 任何帮助将不胜感激

1 个答案:

答案 0 :(得分:2)

定位元素的最佳技巧之一是使用topposition属性。

为了给铅笔留出空间,我们在桌子上添加左边距。我们将铅笔相对定位并从顶部放置20个像素。

现在它出现在桌子的外面和左边。

.fa-pencil {
  top: 20px;
  position: relative;
}

table {
  margin-left: 20px;
}

http://jsfiddle.net/a00ykzy0/1/