M.Mike M.Mike - 1 month ago 5
HTML Question

Why the table th font vertical center is not effect in the css?

I want set the table th font vertical center´╝îbut if It is not effect as I set in CSS like this:

.table-display th {
height: 20px;
font-size:13px;
text-align:center;
vertical-align:middle
}


and the html is:

<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>
......


But if I set the vertical-align style in html instead of css,it took effect:

<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>
......


what is the problem?

Answer

You can use !important in your css class or try below code,

.table-display> thead> tr > th {
    height: 20px;
    font-size:13px;
    text-align:center;
    vertical-align:middle !important;
}
Comments