I'm having trouble getting the CSS to print properly, even after adding the media="print" attribute

Currently, I am working on creating a marksheet format with some CSS styles that need to be included in the print version as well. So far, I have been successful in achieving this goal. However, I have encountered an issue where the background color in the table head is not being printed. Although the styling appears on the web page, it disappears when attempting to print. If anyone has a solution to this problem, I would greatly appreciate it.

Answer №1

It seems like you're saying that you want to print everything but the background.

If you are using Internet Explorer, you can try this:

Right click on the document and select 'print preview'. Then go to settings where you will find an option to "print background color and images". Select that option and give it a try.

If you are using Chrome, you can try this:

Press Ctrl-P to bring up the print dialog, then under more settings, check the box for 'background graphics'.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The child element extends beyond the boundaries of its parent container in HTML

Have you ever encountered a situation where the inner div element is wider than the outer div? It can be a bit frustrating, but there are ways to address this issue. So, what causes this to happen in the first place? And more importantly, how can we ensur ...

The Radix UI Theme's dark mode isn't taking effect

I'm having trouble getting the dark mode to work properly in my Radix UI app. Despite setting appearance="dark", nested components like Box and Card remain light. Interestingly, other props such as accent color seem to be working fine. It&a ...

A guide on selectively removing a value from a javascript object when calling setState in ReactJS

updateDishDetails(id, quantity) { if (quantity !== 0) { this.setState( prevState => ({ bookingFormData: { ...prevState.bookingFormData, dishDetails: { ...prevState.bookingFormData.dishDe ...

Routing specific paths to corresponding components in react-router

I am looking to implement a unique layout for the start screen of my webpage: ----------------------------- | View 1 | View 2 | | LinkA LinkB | LinkC LinkD | | | | ----------------------------- When LinkA or B are clicke ...

Positioning a file drop area discreetly hidden behind a cluttered data-packed table

I have been experimenting with the ngx-file-drop module for Angular 4. Lately, I have been working on adding a file drop feature to a website that displays data in a table using *ngFor and *ngIf directives. My goal was to create a background drop zone beh ...

Ways to prevent react-p5-wrapper from continuing to run in the background

I encountered a problem with react-p5-wrapper where it continues to run in the background even after switching to another route in my react application. For instance, while I am on the /game route, the console keeps logging "running draw". Even ...

React JS build script encounters errors during compilation ordeal

Issue Summary >> npm run-script build is failing to compile the project Expected Outcome Expecting a successful compilation where the build folder contains a minified project with no errors in the output Current Behavior The error encountered du ...

Events for radio buttons in Angular 2

What are the events called in Angular 2 when a radio button is selected or unselected? Is it something like this: <input type="radio" (select)="selected()" (unselect)="unselected()" /> When I click on a radio button in a group, will it trigger sel ...

Unable to update state in my React app when clicking on a button

There is a requirement for a button click to filter the job-card array by one specific category. For example, clicking on the button "Marketing" should only show jobs from the array that have the property "jobstags: Marketing". I followed a similar procedu ...

Looking to add a glowing effect to a div when hovered using jQuery

Seeking assistance to add a glow effect to a div when hovered using jQuery. Below is the code snippet: HTML <div class="tablerow"> <div class="image"> <img src="1.jpg"> </div> <div class="info"> ...

`Enhancing Navigation Links with Scroll-Activated Styling`

I'm attempting to recreate a visual effect that is similar to: Specifically, I am trying to achieve a style where the links in the navigation bar change color when the corresponding section is displayed, such as having the gallery link in the navbar ...

Exploring the Selection State of Rows in Ant Design Table and Passing it to expandRowRender Component

Currently, I am utilizing nested tables within the Ant Design framework. My goal is to ensure that when a row is selected in the main table, all corresponding values in the nested tables for that particular row are also selected. Conversely, if I deselect ...

Substitute the identifier with an element for a specific webpage

Currently, my navigation consists of two list items: <body id="trips"> <nav> <li><a href="/trips.php" class="trips">Trips</a></li> <li><a href="/trips.php?offer=true" class="offers">Offers< ...

The problem in React arises when the event.target becomes undefined or null

I'm currently using React Hooks and I have encountered an issue while trying to update the state within a function that utilizes event.target and event.name. The problem arises as the event object within the handling function returns undefined for bo ...

The functionality of jQuery's .hide and .show methods can sometimes result in unexpected behaviors while

I am experiencing some issues with this code snippet - it is causing some unexpected animations. The first issue is that it is lowering the content by about 1em during the animation and then moving it back up afterwards. The second issue is on the archive ...

Using dryscrape for web scraping: encountering an issue when selecting a radio button with CSS

I am attempting to extract data from a dynamically updated table on a webpage using dryscrape. The web page in question is located at . My code functions correctly with tables that are generated when the page is loaded initially. However, I now need to upd ...

Incorporating an HTML Canvas element within a CSS grid design

I've been attempting to integrate an html canvas that I created into one of the css grid classes specified in my code. The code runs when the "Calculate" button is clicked. Upon clicking the button, the <div> section designated for the canvas r ...

What level of trust can be placed in MUI Global Class names when using JSS?

Here is my current code snippet: const formControlStyles = { root: { '&:hover .MuiFormLabel-root': { } } } Would it be considered secure to utilize the class name in theme overrides for connecting with other components? Furthe ...

Strange Behavior: Material-UI Dialog Closes Unexpectedly on iPhone due to Phantom topClick Events

I've been using the Material-UI Dialog element for quite some time now, and it has always functioned perfectly. However, I recently noticed an issue while testing in Chrome's device emulation mode. It seems that when the dialog or drawer is opene ...

How can I stack two appbar components from Material Ui on top of each other without the vertical line separating them?

I am facing a challenge while trying to incorporate two AppBar components in Material-UI, stacked one on top of the other. The problem arises when a line appears at the end of the first AppBar, overlapping with the second one. Click here to view an image ...