我想设置表格字体垂直居中,但如果它不像我在CSS中设置的效果那样:
.table-display th {
height: 20px;
font-size:13px;
text-align:center;
vertical-align:middle
}
和html是:
<table id="rule-table" class="table table-display table-striped jambo_table" border="1" style="margin-bottom: 5px">
<thead>
<tr class="headings">
<th>Name</th>
......
但是如果我在html而不是css中设置vertical-align样式,它就会生效:
<table id="rule-table" class="table table-display table-striped jambo_table" border="1" style="margin-bottom: 5px">
<thead>
<tr class="headings">
<th style="vertical-align:middle;">Name</th>
......
问题是什么?
答案 0 :(得分:0)
您可以在!important
课程中使用css
或尝试以下代码,
.table-display> thead> tr > th {
height: 20px;
font-size:13px;
text-align:center;
vertical-align:middle !important;
}
答案 1 :(得分:0)
你只需要在CSS文件中给予!important即可。这将覆盖其他CSS。