我試圖完成對齊的數字水平居中的盒子,但像這樣的圖像中排列的數字權:對齊的數字水平的中間偏右
如果你覺得我應該嘗試不同的方法請給我建議。
* {
margin:0;
padding:0;
}
.table{
width: 70px;
border-collapse: collapse;
border-width: 0;
}
th,td {
padding: 2px 5px 2px 5px;
text-align: center;
}
span {
display: inline-block;
text-align: right;
}
<html>
<head>
<link rel="stylesheet" href="check.css">
</head>
<body>
<table class="table">
<thead>
<tr>
<th>Numbers</th>
</tr>
</thead>
<tbody>
<tr>
<td><span>8</span></td>
</tr>
<tr>
<td><span>9</span></td>
</tr>
<tr>
<td><span>10</span></td>
</tr>
<tr>
<td><span>11</span></td>
</tr>
<tr>
<td><span>12</span></td>
</tr>
</tbody>
</table>
</body>
</html>
數將是動態的(在一到四個字符)
什麼問題,你的代碼是好的,不是? –
@TemaniAfif,我也很強悍,一見鍾情,我沒有看到它,但數字右對齊的圖像(幾十對齊十等等)。 –
啊好吧,我看到了,我認爲傑克給出了正確的答案,所以;) –