我對HTML和CSS中的項目進行對齊有一個問題。我有一個價格,這些價格必須左對齊,但正如你可以看到這些項目左對齊,但4必須是80的0。這些是價格,我認爲這不是很好。對齊HTML中的項目
我忘了提到的一件事是這些價格不是手動添加價格。這些是通過API生成的。所以在你給我的解決方案中,你可以拆分數字和小數。在這種情況下,它是一個數字。也許有一種方法可以分解數字並以這種方式解決問題,但我希望有更好的解決方案。我也給你更好的觀點。唯一需要更好對齊的是右側的表格行,而不是左側的表格行。正如你在圖片中看到的。
編輯: 代碼:這是HTML代碼,我也用AngularJS
<td md-cell class="tableWidthSell tableBorderLeft tableInnerCell">
<table md-table class="innerTable">
<tbody>
<tr md-row class="datatableRow" ng-repeat="order in term.timeblocks.INTRADAY.SELL | orderBy: 'price': true">
<td flex="100" class="tablePaddingLeft clickable" ng-click="openOrder($event, order)" ng-class="{tableMyOrder: order.mine}">{{order.price|number:2}}</td>
</tr>
</tbody>
</table>
</td>
<!--Price data | Sell -->
<td md-cell class="tableWidthSell tableInnerCell">
<table md-table class="innerTable">
<tbody>
<tr md-row class="datatableRow" ng-repeat="order in term.timeblocks.INTRADAY.SELL | orderBy : 'price' : true ">
<td flex="100" class="tablePaddingLeft clickable" ng-click="openOrder($event, order)" ng-class="{tableMyOrder: order.mine}"> {{order.quantity|number:1}}</td>
</tr>
</tbody>
</table>
</td>
我希望有人仍然可以幫助我。
把你的代碼,請。 –
顯示您的代碼請 – Federico
您使用的是角度材料 –