Override CSS table formatting

人盡茶涼 提交于 2020-01-07 02:12:22

问题


I use the following CSS to apply a top border to the last-child row of various tables:

.mytabs tr:last-child {
border-top:1px solid #000;
font-weight:bold;}

Now what I need to do is to override this style for one particular table. How can I override this style in one specific instance? Thanks.


回答1:


You can wrap it a custom div id name example <div id="customFormat"></div> or give the table an id <table id="customFormat"></table>

In CSS, you can specify the custom styling just for that 1 table.

#customFormat { 
border-bottom: 1px solid rgba(69,54,37,0.2);
}



回答2:


Give a class specific table or to the last row of specific table and apply style

table.<specific_table> tr:last-child {
...your style
}

or

.mytabs tr.<specific_row> {
..your style}


来源:https://stackoverflow.com/questions/8707481/override-css-table-formatting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!