Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Border for table th not working in IE

I have datagrid table with some styles applied to it. Everything is working fine Chrome and Firefox but border is not applied to table thead th in IE. the borders are seen when I apply the same styles to table tbody td. In the following styles, border-left is not working in IE.

.datagrid table thead th {
color: #4180ab;
font-size: 12px;
font-weight: bold;
line-height: 30px;
text-align: center;
border-left: 1px solid #a8cbd1;
background: #f1f6fa;
}

//HTML Markup

<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
<thead class="thead">
    <tr>
        <th>No</th>
        <th>Application Number</th>
        <th>Given Name</th>
        <th>Family Name</th>
        <th>Nationality</th>
        <th>Passport Number</th>
        <th>Visa Type</th>
        <th>Transaction Type</th>
        <th>Submission Date</th>
    </tr>
</thead>
<tbody>
    <tr class="gradeX">
        <td>1</td>
        <td>APP1212</td>
        <td>Steven</td>
        <td class="center">Gerrard</td>
        <td class="center">British</td>
        <td>12121212</td>
        <td>Tourist Visa</td>
        <td>454584545</td>
        <td>20-01-2014<img src="images/lock.png" alt="" class="lock"></td>
    </tr>
    <tr class="gradeC">
        <td>2</td>
        <td>APP1012</td>
        <td>Fernando</td>
        <td class="center">Torres</td>
        <td class="center">Spanish</td>
        <td>12121212</td>
        <td>Short Work Visa</td>
        <td>454584545</td>
        <td>20-01-2014<img src="images/lock.png" alt="" class="lock"></td>
    </tr>
    <tr class="gradeA">
        <td>3</td>
        <td>APP1512</td>
        <td>Xabi</td>
        <td class="center">Alonso</td>
        <td class="center">Spanish</td>
        <td>12121212</td>
        <td>Tourist Visa</td>
        <td>454584545</td>
        <td>20-01-2014<img src="images/lock.png" alt="" class="lock"></td>
    </tr>
    <tr class="gradeA">
        <td>4</td>
        <td>APP1282</td>
        <td>Zlatan</td>
        <td class="center">Ibrahimovic</td>
        <td class="center">Swedish</td>
        <td>12121212</td>
        <td>Short Work Visa</td>
        <td>454584545</td>
        <td>20-01-2014<img src="images/lock.png" alt="" class="lock"></td>
    </tr>
    <tr class="gradeA">
        <td>5</td>
        <td>APP1612</td>
        <td>Robin</td>
        <td class="center">Van Persie</td>
        <td class="center">Dutch</td>
        <td>12121212</td>
        <td>Tourist Visa</td>
        <td>454584545</td>
        <td>20-01-2014<img src="images/lock.png" alt="" class="lock"></td>
    </tr>

            <tr class="gradeX">
        <td>6</td>
        <td>APP1212</td>
        <td>Steven</td>
        <td class="center">Gerrard</td>
        <td class="center">British</td>
        <td>12121212</td>
        <td>Tourist Visa</td>
        <td>454584545</td>
        <td>20-01-2014<img src="images/lock.png" alt="" class="lock"></td>
    </tr>

</tbody>

</table>
like image 979
dvln Avatar asked Feb 23 '14 06:02

dvln


People also ask

How do I enable table borders?

To create table border in HTML, the border attribute was used. But the introduction of HTML5, deprecated the border tag. Create table border using the CSS property border. Set table border as well as border for <th> and <td>.

Are table borders deprecated?

W3C DOM 2 HTML Specification HTMLTableElement. border. This attribute is deprecated in HTML 4.0.

How do you change the table border?

Go to Table Tools >Design > Table Styles > Borders, and then click the border option that you want to change.

Which properties can you use to get the table border?

To specify table borders in CSS, use the border property.


1 Answers

The best solution I've seen to this problem is applying

background-clip: padding-box;

to the th elements.

IE seems to render the background over the borders in some situations without this.

like image 187
stealthwang Avatar answered Sep 21 '22 05:09

stealthwang