Is there a way to hide the link within an a tag when printing?
.p {
display: none;
}
@media print {
.p {
display: initial;
}
.np {
display: none;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<button class="btn btn-large btn-success np" onClick="window.print()">Print</button>
<table id="myHeader" class="table table-striped table-hover table-bordered table-responsive">
<thead>
<tr>
<th>Sr.</th>
<th>Student</th>
<th>Marks</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td><a href="http://jainvidhya.co.in/result.php?arn=CB2017AS11Z89010" target="_blank" class="np">Anu Bohra</a> <span class="p">Hi</span></td>
<td>30</td>
</tr>
</tbody>
</table>
I attempted to use the class (np) on the a tag, but it only displayed "Hi" in the second column.
What I want is to show both the content between the opening and closing a tags as well as "Hi".
Instead of displaying content + link + Hi, my code currently shows just content + Hi.