I have a table. Above the table, I create a horizontal line. When I click on the print button, the whole page is showing except the lines. The lines are generated as follows:
$attachLinesTo = $('#dataset-wrap')
function createLine(x1, y1, l, colorClass) {
return $('<div>')
.appendTo($attachLinesTo)
.addClass('line ' + colorClass)
.css({
position: 'absolute',
})
.width(l)
.offset({
left: x1,
top: y1
});
}
In the normal view (without printing) the page is showing everything correct. Only on the print page, the lines are missing.
I want to show the lines in the print view.
Here the css:
.line {
transform-origin: 0 100%;
height: 1px;
border: 0;
}
.black {
background-color: black;
}
2
Answers
I changed know the div as follow:
css is know:
it is visible on the page but not on printing.
By default, your browser doesn’t print background colors.
You have to either enable background printing in your browser, or just use a border-top (or border-bottom) that is 1px and that should work.