简体   繁体   中英

Right align Text in table cell with CSS

Site: http://bit . ly/1qbtSEN

Well, I've tried every CSS selector combo I can think of, and I still cannot get only the prices column text to right align in the table cell. I can right align the table td but that also right aligns the text in the size column. . Any help with the correct selector would be fantastic.

table td:nth-child(2) {
    text-align: right;
}

Put a class on your td with text-align: right;

在此处输入图片说明

Edit: If you're not worried about IE8 compatibility, CroaToa's answer https://stackoverflow.com/a/25002805/1355087 is the selector you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM