Hello I try to remove border from my table when the user click button print (window.print) using css but it stay always in printed page
this is my css code :
@media print{
body * {visibility: hidden;
}
table {
border:solid; white !important;
border-width:1px 0 0 1px !important;
border-bottom-style: none;
}
th, td{
border:solid; white !important;
border-width:0 1px 1px 0 !important;
border-bottom-style: none;
}
}
this css gave me this result :
The bottom border of table stay showing How do I can remove it Thank u
You could use in your CSS3 @media Rule:
border-bottom: none;
or
border: solid white !important;
Using border-bottom: none;
could effect the layout of you table when printing (depending if you are using box-sizing
with default value or not).
Below an example:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<style>
table {
/* just an example */
border: solid red;
border-width: 1px 0 0 1px !important;
border-bottom-style: none;
}
@media print {
table {
border: solid white !important;
border-width: 1px 0 0 1px !important;
border-bottom-style: none;
}
th, td {
border: solid white !important;
border-width: 0 1px 1px 0 !important;
border-bottom-style: none;
}
}
</style>
</head>
<body>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With