Creating a webpage that utilizes varying headers for each section can help to

When trying to print a multi-page webpage, I encounter an issue with the headers. How can I ensure that different headers appear on each page after the first one?

Specifically, my problem arises when a label on the first page spans across to the second page. This causes the header on the second page to be the same as the first, when I actually want it to be different.

I have tried defining the headers using a table structure like this:

<table>
     <thead>
             (...Header Html Code)           
     </thead>
     <tbody>
            (...Html Code with label containing lots of text)
     </tbody>
</table>

Answer №1

If you want to customize your website's appearance for different purposes, such as print or mobile view, you can create separate CSS files for each scenario. For example, you could have styles specifically for braile readers or mobile devices.

<link rel="stylesheet" type="text/css" href="path/to/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="path/to/print.css" media="print" />

Start by defining the styles for displaying on screen...

div#header {
 font-family: verdana;
 margin: 4px;
 font-size: large;
 font-weight: bold;
 background-color: #c0c0c0;
 border: #191170 2px solid;
}

...and then adjust the styles for printing

div#header {
 font-family: arial;
 font-weight: bold;
 font-size: 20px;
}

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

What is the best way to retrieve the content of a file and set it as the value

exam.php <div class='btitle'>LOREM</div> main.php <?php $content = file_get_contents('exam.php'); ?> <textarea class='txa' value = <?php echo $content; ?>></textarea> outcome text ...

Using CSS Grid to Create Three Rows of Equal Height

I am facing an issue with my vertical menu that stretches 100% height. The rows inside this menu need to have equal height and be stretched to fit the container. Additionally, I noticed that adding a button seems to drop the container slightly below the pa ...

CSS table row border displaying irregularly in Chrome and Internet Explorer

I recently created a basic table with bottom row borders. Surprisingly, the borders display perfectly in Firefox but only partially in Chrome and IE 10: <div style="display:table; border-collapse: collapse; width: 100%"> <div style="display:table ...

Is there a way to assign the scroll event context to `document.body` instead of `window`?

Discovery As I delved into the intricacies of web development, I stumbled upon a curious observation. In a particular MDN page, I noticed that the left and right sidebars had their scrollbars contained within themselves. However, the content block's ...

The function send_filer either returns None or finishes execution without encountering a return statement

I am currently developing an application where users can download a plot.png and a file.csv, but the send_files function isn't working as expected. Below is my Python code: app = Flask(__name__) app.USE_X_SENDFILE = True @app.route('/', met ...

I need help figuring out how to create dynamic bars that change colors based on their values. Any suggestions on how to

Seeking a solution to create interactive live-charts similar to the image provided. I've explored various chart libraries like Highcharts, fusioncharts, raphaeljs and many others, but haven't found one that fits my needs perfectly. I experimented ...

The nested ThemeProvider takes priority over the theme's style definitions

Is there a way to render a component and then apply additional rendering using useEffects in React? The issue I am facing is that when I have a component with a specific theme, each useEffect call ends up overriding the style of the original component wit ...

Having difficulty retrieving data from an HTML file using HTMLEditorKit with Java

Within my HTML code, I have tags structured like this: <div class="author"><a href="/user/1" title="View user profile.">Apple</a> - October 22, 2009 - 01:07</div> I am aiming to retrieve the date, "October 22, 2009 - 01:07" from e ...

Creating a div element with a fixed size that remains the same regardless of its content

Check out the code snippet below for displaying an image and title: <div id="eventsCollapsed" class="panel-collapse collapse" ng-controller="videoController"> <div class="panel-body"> <div ...

What is the proper way to specify the background image path in CSS?

My CSS file is located at: Project/Web/Support/Styles/file.css The image I want to use is found here: Project/Web/images/image.png I am attempting to include this image in my CSS file. I have tried the following methods: 1) background-image: url(/images ...

Having trouble making the swing effect trigger on mouseover but not on page load

I am trying to achieve a swinging effect on mouseover only, not on page load. Below is the JS code I have: (function swing() { var ang = 20, dAng = 10, ddAng = .5, dir = 1, box = document.getElementById("box"); (function setAng(ang){ ...

When you hover over the text, the color will shift

I have created two boxes that are blue with white text and change to a different color scheme when hovered over. However, I am experiencing an issue where the text color reverts back to the original color when hovering below the text area of the box. Here ...

How can you incorporate a tag at the end of an HTML link, such as edit.php?id=0, to retrieve the value 0 as a variable in PHP?

Recently, I created a page that prints data from a SQL server. In addition, I developed an edit page (edit.php) where users can modify individual lines by entering new information into a textbox and submitting it for updating in the database. My current o ...

I can't get Toggleclass to switch classes properly, am I missing something?

I have been experimenting with creating a button that toggles a class and reveals another div below it. Feel free to check out the example on jsFiddle that I created for you. While the first function of showing and hiding the div is working perfectly, I ...

JavaScript visibility disappearing intermittently

I have created a custom image viewer box that overlays a thumbnail gallery page. The image viewer should appear when a user clicks on a thumbnail. However, currently, the viewer only pops up briefly and then disappears again. I am looking for a way to mak ...

What are the steps to create a dynamic navigation menu in Angular 2?

I have successfully implemented this design using vanilla CSS and JS, but I am encountering challenges when trying to replicate it in Angular 2. Setting aside routing concerns, here is the current state of my component: navbar.component.ts import { Comp ...

Transferring data from a text area to a table with AngularJS

Creating a C# MVC App with AngularJS My goal is to populate a table with values entered in a text area using Angular. Here is the process: Users input values into a text area like this: A B C When a user clicks a button, a modal window should open and ...

Prevent the onclick function of a span element from being triggered when the user clicks on a dropdown menu contained within

Just delving into the world of web development and currently tackling a React project. Encountered an issue where I need to make a span element clickable. However, there's a dropdown within that span that doesn't have any onClick event attached t ...

Tips for uncovering a concealed div within an iframe?

It's as if there's a mystery surrounding how to reach this elusive div... div#someId iframe html>head>body div.wrapper div.footer Naturally, my strategy: #someId iframe body .footer is proving to be ineffective. ...

What is the method to display HTML code using JavaScript within a span element in a JSP page?

While working on a jsp file, I came across a span tag with the following code: <span id="divBasicSearchResults" style="height:100%;"></span> Below is the Javascript function that generates HTML content for this span: function renderBasicSear ...