özellikle zarif olmasa da, benim site genelindeki css dosyasında böyle bir şey atmak ister:
.tr1 td:nth-child(1), .tr1 th:nth-child(1),
.tr2 td:nth-child(2), .tr2 th:nth-child(2),
.tr3 td:nth-child(3), .tr3 th:nth-child(3),
.tr4 td:nth-child(4), .tr4 th:nth-child(4),
.tr5 td:nth-child(5), .tr5 th:nth-child(5),
.tr6 td:nth-child(6), .tr6 th:nth-child(6),
.tr7 td:nth-child(7), .tr7 th:nth-child(7),
.tr8 td:nth-child(8), .tr8 th:nth-child(8),
.tr9 td:nth-child(9), .tr9 th:nth-child(9) { text-align:right }
.tc1 td:nth-child(1), .tc1 th:nth-child(1),
.tc2 td:nth-child(2), .tc2 th:nth-child(2),
.tc3 td:nth-child(3), .tc3 th:nth-child(3),
.tc4 td:nth-child(4), .tc4 th:nth-child(4),
.tc5 td:nth-child(5), .tc5 th:nth-child(5),
.tc6 td:nth-child(6), .tc6 th:nth-child(6),
.tc7 td:nth-child(7), .tc7 th:nth-child(7),
.tc8 td:nth-child(8), .tc8 th:nth-child(8),
.tc9 td:nth-child(9), .tc9 th:nth-child(9) { text-align:center }
sütuna 2 istiyorsanız, merkez veya sağa hizalanmış yani istediğiniz sütun numaraları Sonra sadece belirtmek CSS süper zarif olmasa da
<table class="tr2 tc3 tr7">
, alternatifleri daha da az zariftir: & 7 sağa hizalanmış ve 3 sadece yap, merkezli her tablo için özel bir sınıf, yani ya bir olması için her tr
gerektiren class="ralign"
veya benzerleri.
Doesn't work with IE8
Muhtemelen ikinci sütunda her hücrede demek. Yapmam gereken şey bu. Sadece güzel bir yol olup olmadığını merak ediyorum ... –
CSS3 bunu daha güzel bir şekilde yapmasına izin veriyor, ancak şimdilik tüm tarayıcılarda desteklenmiyor. – Anton
Eğer 'tr td: first-child + td {text-align: right'i kullanırsanız; } 'IE üzerinde çalışacaktır <= 8. – Cthulhu