1
我使用字體真棒爲我的圖標和一個簡單的表。css - 如何在字體集中字體真棒圖標?
如何讓此圖標位於td
的中心? 我正在嘗試使用text-align: center
,但沒有奏效。
有人有一個更好的主意如何解決這個問題?
謝謝。
jsfidle:https://jsfiddle.net/s15dxabc/
table i {
color: red;
background: #ffffff;
border-radius: 20px;
padding: 5px 0;
width: 30px;
margin-right: 5px;
border: 2px solid black;
text-align: center;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<table>
<thead>
<tr>
<td> this icon should be in the center</td>
</tr>
</thead>
<tbody>
<tr>
<td><i class="fa fa-minus"></i></td>
</tr>
</tbody>
</table>
'的text-align:中心'爲'td',而不是'i' – Duannx