我有以下的CSS:採取最後的孩子,而不是第一胎上唯一表行
table tbody tr:last-child td {
padding-top: 7px;
border-bottom: 0;
}
table tbody tr:first-child td {
padding-top: 6px;
}
現在我可以有一個表只有一行。
唯一的錶行現在被分配到first-child
而不是last-child
,但我希望它是相反的方式。
有沒有沒有Javascript的方法?
「我怎樣才能最後孩子分配給所有,而不是第一胎」?你能改述嗎?你在哪裏定義了一個邊界底? – fcalderan
也許是一個愚蠢的問題,但你有沒有嘗試'border-bottom:none;'和'border-bottom:0px;'? – poepje
@poepje:它不會影響表格行,因爲正如我在開發者控制檯中看到的那樣,「first-child」被分配給該行。 @ F.卡爾德蘭:我盡力去做,但是我很難解釋。 –