2 回答

TA貢獻1773條經(jīng)驗 獲得超3個贊
您不能將outline.
table-cell樣式不允許典型div或span標記可以具有的所有樣式。將您的單元格數(shù)據(jù)嵌套在另一個元素中并在其上設(shè)置樣式。
table {
border: 3px solid orange;
}
td {
padding: 0.25em;
}
.color {
background-color: rgb(0, 255, 0);
border-radius: 10px; /* around the border */
border: 3px solid red; /* inside the outline, outside the padding */
outline: 3px solid aqua; /* inside the cell, outside the offset/border */
outline-offset: 3px; /* inside the outline, outside the border */
padding: 0.25em; /* inside the border */
margin: 3px; /* inside the cell, outside the outline */
}
<table>
<tr>
<td><div class="color">1</div></td>
<td><div class="color">2</div></td>
<td><div class="color">3</div></td>
</tr>
</table>

TA貢獻1827條經(jīng)驗 獲得超4個贊
要對每個數(shù)字進行四舍五入,請使用以下代碼片段。
#rcorners1 {
border-radius:85px;
padding: 10px;
width: 20px;
height: 15px;
background-color: rgb(0,255,0);
<table>
<tr>
<td class=rcorners1 id=rcorners1>1</td>
<td class=rcorners1 id=rcorners1>2</td>
<td class=rcorners1 id=rcorners1>3</td>
</tr>
</table>
添加回答
舉報