Tips for displaying text above an HTML table on all pages

Issues arise when writing text above a table in HTML; the table displays correctly on the first page, but on subsequent pages, the text overlaps with the table content. This problem persists across all pages except the initial one. Attempting to resolve this using @media print has been unsuccessful. The challenge lies in the fact that the long table automatically flows onto multiple pages, causing the text placement issues when trying to utilize @media print. Furthermore, there is a requirement for the footer to always remain at the bottom of each page, even if the table does not fill the entire space. However, setting the position: fixed; property causes the footer to overlap with the final row of the table, while omitting it results in the footer appearing below the last row if the table is not full, positioning it in the middle of the page.

The provided code snippet includes CSS styling for handling the printing behavior and layout:

....(remaining code here)....

Answer №1

If you adjust the positioning to absolute and specify the desired distance from the top of the page, you will achieve a page size slightly exceeding 20cm

.page-footer {
  position: fixed;
  bottom: 0px;
  width: 97.3%;
  padding: 3px 1px;
  background-color: #ffffff;
  border-top: 1px solid #000000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

transforms into:

.page-footer {
  position: absolute;
  top: 20cm;           // this replaces the use of 'bottom'
  // and so on

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

Angular - Dividing Functionality into Multiple Modules

I am currently working with two separate modules that have completely different designs. To integrate these modules, I decided to create a new module called "accounts". However, when I include the line import { AppComponent as Account_AppComponent} from &a ...

Location-based services: Updating the position of a Google Maps marker without refreshing the entire map interface

How can I update only the marker on a map when the device is in motion or has increased accuracy? I want to reload the map when the position changes, but only move the marker. Below is the code snippet that I currently have: if (navigator.geolocation) { ...

Exploring the functionalities of the Django messaging system

Regarding the messaging framework, I came across a documentation that mentions each message having a message.tag property which can be used for styling with CSS. My code implementation is as follows: try: models.save() message.success(request, "Mo ...

Ways to format a C# string outcome showcased in HTML (ASP.NET)

I'm facing an issue with formatting the output (string) retrieved from a C# database connected to ASP.NET. I want to style the row["Grens"] differently from row["Sanctie"], for instance. The result is displayed in a basic div: <div id="resultaat" ...

Elevate Your Game: Mastering asp MVC/Razor

I am looking for a way to make the title of a field go over the input when information is entered. Here is the code I currently have: In the field, we have the text "FIRSTNAME". My goal is to have the text "FIRSTNAME" move over the field when information ...

What is the best way to connect an image using Flask and javascript?

I'm attempting to insert an image into a card using JavaScript, structured like this: console.log(account_name); document.getElementById("list_of_datasets").innerHTML += ` <div class="col-lg-4 d-flex align-items-stret ...

Embedding content within a toggle slider

As a beginner in CSS, I have a simple question that needs addressing. I am unsure which class to begin with for my task. The goal is to insert text (specifically, two digits) neatly inside toggle buttons (the slider that moves and appears white). I am u ...

Selecting a value from a populated dropdown and checking the corresponding checkbox in SQL Server

There are 8 checkboxes in this example: <table style="border-collapse: collapse; width: 100%;" border="1"> <tbody> <tr style="height: 21px;"> <td style="width: 25%; height: 21px;"><strong>Technology</strong& ...

Triggering an animation on one element by hovering over a different element

I'm trying to create a cool effect where the train ticket rotates when I hover over a leaf. Although I can get the train ticket to rotate when I hover over it directly, it doesn't seem to work when I hover over the leaf. Can someone help me spot ...

Creating a Venn diagram in an .html file with Flask: A tutorial

I am looking to display a Venn diagram on my HTML page using the return render function in Flask. Despite making several attempts, I have been unsuccessful so far. While matplotlib allows me to plot other types of graphs, I haven't discovered a metho ...

Arranging div elements in a vertical stack with CSS

Looking for help in arranging div elements in a way that they resemble an equalizer, similar to the one shown in this screenshot Equalizer. Can you provide advice on how to remove the dots from the list? I've already attempted using the CSS property ( ...

Guide to activating the submit button when a radio button is selected

Here is the code snippet for an edit form <form [formGroup]="editForm" (ngSubmit)="saveUser()" novalidate> <div class="form-group"> <label class="block">Gender</label> <div class="clip-radio radio-primary"> &l ...

Guide on applying css to a single element while concealing another using Jquery

Looking to enhance my javascript skills by adding CSS to another element when a particular element is hidden. I've got the hiding/showing part down, but now I want to take it a step further. For example: How can I style div2 differently when div1 is ...

Positioning two elements next to each other and keeping them aligned evenly

CSS - How to Float Two Elements Side by Side I am facing a similar challenge in achieving the layout I want. With a percentage-based layout, either my menu overlaps with the content or the content gets pushed below the menu when viewed on mobile devices. ...

Fade the background image to 50% opacity as you scroll down

Currently, I am utilizing the Backstretch jQuery plugin and aiming to darken the background while scrolling down. This is my progress so far: Setting the body background color to dark Adjusting the opacity of the background image to 0.4 when scrolling dow ...

Error occurs while attempting to access document.getElementById

I've been trying to make the following code display the word "Test", but all I'm getting is a message saying "TypeError: document.getElementById(...)". I can't seem to figure out what's wrong: <html> <head> <meta h ...

Update the content of a div using jQuery and AJAX by targeting a specific button ID

I am in the process of developing a website that functions as an interactive "choose your own adventure" game. The page will present users with a question along with three different choices represented as buttons. Upon selecting one of the options, jQuery ...

Using Column CSS Property with Google Maps in Chrome: A Potential Bug?

I'm facing an interesting issue and I could use some help understanding or fixing it. It seems like there might be a bug or a solution to this problem. I am currently working on a layout using the CSS3 property columns. Everything looks fine in Firefo ...

Identify and extract all HTML content enclosed within two specified tags, then save them in a JavaScript object

I have a similar setup in my HTML code: <div class ="personal-datas">Data1</div> <h2 class ="name">John Doe</h2> <div class ="date-of-birth">January 1st, 2000</div> <h3 class ="company">ABC Corp</h3> <h ...

Tips for setting up a sub-menu upon clicking the menu in the Magister Bootstrap theme

I recently implemented the bootstrap theme Magister, but I am struggling to add a sub-menu to the menu dropdown upon clicking on the menu. Can someone please take a look and provide some advice on where I might be going wrong? .mainmenu .dropdown-menu { ...