Andrew
Andrew

Reputation: 12010

Suppress rendering of HTML link in JQuery datatable when printing

Preamble: For a variety of reasons, I still have to use DataTables 1.9.

When I render a table, everything looks great, including the link that the table value leads to:

enter image description here

However, in the print view, the HTML link is also included:

enter image description here

How can I suppress the printing of the HTML link?

Upvotes: 3

Views: 740

Answers (2)

M. Salah
M. Salah

Reputation: 681

I removed this from bootstrap css and then print is good:

a[href]:after{content:" (" attr(href) ")"}

Upvotes: 1

Andrew
Andrew

Reputation: 12010

Turns out this isn't a JQuery datatable thing — it's a bootstrap thing. The bootstrap CSS includes the following:

a[href]:after {
  content: " (" attr(href) ")";
}

If I override this in my print CSS, everything is good.

Upvotes: 2

Related Questions