What is the process for generating a printable report using HTML, CSS, and ASP.NET Core?

I am looking to create a customizable report using HTML and CSS, however I am not familiar with designing forms like pay slips that can be easily printed. Please see the images I have shared below for reference. Any help or guidance would be greatly appreciated. Thank you!

https://i.sstatic.net/3XjbR.png

https://i.sstatic.net/huzni.png

Answer №1

If you want to modify the table layout, consider using colspan and rowspan. Below is a straightforward example:

    <table width="100%">
    <tr>
        <td colspan="9">first line</td>
    </tr>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td rowspan="2">
            4
        </td>
        <td rowspan="2">
            5
        </td>
        <td>6</td>
        <td>7</td>
        <td>8</td>
        <td>9</td>
    </tr>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td>6</td>
        <td>7</td>
        <td>8</td>
        <td>9</td>
    </tr>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td rowspan="2">
            4
        </td>
        <td rowspan="2">
            5
        </td>
        <td>6</td>
        <td>7</td>
        <td>8</td>
        <td>9</td>
    </tr>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td>6</td>
        <td>7</td>
        <td>8</td>
        <td>9</td>
    </tr>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td rowspan="2">
            4
        </td>
        <td rowspan="2">
            5
        </td>
        <td>6</td>
        <td>7</td>
        <td rowspan="2">8</td>
        <td rowspan="2">9</td>
    </tr>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
        <td>6</td>
        <td>7</td>

    </tr>
</table>
   

     <style>
            table, th, td {
                border: 1px solid black;
                text-align:center;
            }
        </style>

The outcome can be viewed here: https://i.sstatic.net/s5025.png

To further customize the appearance, try adjusting the width, height, text-align, or background for each tr/td element.

Answer №2

Discover a plethora of templates and guides available online to discover the perfect design for your needs.

Ensure to include width:100% in order to secure a fixed display for your forms on the page, along with margin:10px (example) to keep your content neatly contained within the bounds of your webpage.

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

Utilizing jQuery to assign a value to a SPAN tag

In my code, there is an element with the following syntax: <span id="userName.errors" class="errors">Enter Your User Name </span>. I am interested in utilizing jQuery to delete either the text 'Enter Your User Name' or any element tha ...

Having trouble capturing a photo from webcam using HTML5 and getUserMedia() in Google Chrome upon initial page load

Using the information from an article on HTML5Rocks, I am attempting to create a tool that can capture photos from a webcam. Here is an excerpt of my HTML code: <button type="button" name="btnCapture" id="btnCapture">Start camera</button>< ...

Converting long date format to short date format: yyyy-mm-dd

Is there a way to convert the long date format from "Sat Dec 13 2014 06:00:00 GMT+0600" to "2014-12-13" in yyyy-mm-dd format? <script> function myDate(val) { var now = new Date("<?php echo $Cnextdue;?>"); now.setDate(now.getDate() + 30*val); ...

What is a common mistake when using refs in React?

I've recently started diving into React. I've seen conflicting opinions on using refs - some sources claim it's a bad practice altogether. Can someone clarify this for me? Is it harmful to attach refs to child components in order to access ...

HMTL and CSS: A centrally-aligned element is not appearing in the center correctly

Take a look at this link: http://jsfiddle.net/QbMmX/1/ You'll notice that the box (div element) is moving more to the left than the text. It doesn't center like the text does. Can you explain why this happens and suggest ways to fix it? ...

Having EventListeners set up across a single CSS class returns null when applied to different types of elements simultaneously

I want to create floating labels that resize dynamically when an input is clicked, similar to modern forms. I am using vanilla JS exclusively for this task. Currently, the setup works with the <input> tag. However, it does not work with the <text ...

Upon the initial gallery load, the images are appearing on top of each

Currently, I am working on creating a gallery page for my website using the Isotop filtering plugin. To view the live gallery, you can visit: carroofies.com/gallery The main issue I am encountering is with the initial load of the page, where the images ov ...

Place the image at right:0px position, but it won't display

I am trying to position an image at the end of a sentence within a div element. No matter what I try, the image always appears next to the end of my text. Here is the code I am using: <div id='xi' class='xc'>Text comes here and ...

Tips for accessing files following the transmission of a post request within the req.body

Encountering a problem where image uploads to an s3 bucket are not successful. The error message received is: API resolved without sending a response for /api/upload/uploadPhoto, this may result in stalled requests. The front end includes an input that ca ...

Assistance needed with utilizing ajax and jquery for submitting a nested form

So, I'm new to using jQuery and Ajax. However, the code snippet below seems to stop working after the second attempt of submitting the form. Here is the JavaScript code: $(document).ready(function() { var options = { target: '#outp ...

Preserve the chosen option in a dropdown menu even after a postback using JavaScript

Seeking Help in Retaining Dropdownlist Selected Value After Postback In my efforts to retain a dropdownlist selected value after postback, I have been exploring various methods. I extract the selected values from the dropdownlist and store them in local ...

Tips for implementing async/await with the file system module

Can you explain the approach to deleting a file using the async/await syntax in combination with fs.unlink() for a specified path? ...

Error Message: Undefined Constructor for Firebase Google Authentication

Hey there! I've been working on integrating Firebase google authentication into my project. Unfortunately, I encountered an error while testing it out. Here's the error message that appeared in the console: Uncaught (in promise) TypeError: Cannot ...

Engage with elements enhanced by jQuery functionality

Here's a simple example: <div id="test">add more text</div> Clicking on the above text triggers this code: jQuery('#test').on('click', function (event) { $('body').append("<div id='newtest' ...

unable to adjust the maximum height limit

I've been struggling to set a maximum height on the slider I'm currently using. No matter what height value I input, it doesn't seem to take effect. Additionally, I attempted setting the width for the echo img row in the PHP section but enco ...

What is causing the React text component to fail to show changes made to my array state?

I am currently in the process of learning React Native. I have been working on an app and encountered an issue while attempting to update individual elements within an array. Here is an example of the code: function MyApp() { const [array, setArray] = ...

retrieve information at varying intervals through ajax

In my web page, there are two div elements that both fetch server data using AJAX. However, div-a retrieves data every second while div-b retrieves data every minute. How can I adjust the frequency at which each div fetches server data? ...

Seeking insight on the implementation of the next() function in expressjs

I'm struggling to understand the concept of the next() method in express.js. I'm curious if next() is exclusive to express.js. Another question that comes to mind is, in the code snippet below, what exactly does next() do? Does it move to the fol ...

I am currently attempting to hide a tab and its corresponding sections on the Dynamics 2011 CRM form upon loading

I have been working on a Dynamics 2011 CRM form where I am attempting to hide a tab and its sections from the onload event. Even though my code runs without any errors, the tab always remains visible. It seems like the custom code I wrote works initially ...

The "hover" effect is not activating on a carousel

I'm having trouble with the hover effect inside the orbit slider. It's not working at all. What am I missing here? Check out the code and fiddle: http://jsfiddle.net/Bonomi/KgndE/ This is the HTML: <div class="row"> <div class="la ...