Formatting tables

Below is the table structure that I have. I attempted to insert empty tds divs in order to achieve the formatting shown in the image, but I have not been successful. Any suggestions or ideas would be greatly appreciated.

<table border="0" cellpadding="1" cellspacing="0" width="100%">
    <tR>    
    <td align="center"> <strong>ONE</strong></td> 

    <td align="center"><strong> TWO</strong></td>

    <td align="center"><strong>THREE</strong></td>
    </tR>

    <tr>
        <td align="left">Quiz NAME</td>
        <td align="right">FINAL</td>
        <td align="right">USS </td>
        <td align="right">PA </td>
        <td align="right">INTL </td>        
        <td align="right"> FINAL</td>
        <td align="right"> USS</td>
        <td align="right"> PA </td>
        <td align="right"> INTL </td>
        <td align="right"> FINAL</td>
        <td align="right"> USS</td>
        <td align="right"> PA</td>
        <td align="right">INTL</td>     
    </tr>
    <TR>DATA HERE</TR>

   </table>

Answer №1

Check out this functional code snippet:

<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tR>    
<td colspan="4" align="center"> <strong>ONE</strong></td> 

<td colspan="4" align="center"><strong> TWO</strong></td>

<td colspan="4" align="center"><strong>THREE</strong></td>
</tR>

<tr>

    <td align="center"align="center">FINAL</td>
    <td align="center" >USS </td>
    <td align="center"align="center">PA </td>
    <td align="center">INTL </td>        

    <td align="center"> FINAL</td>
    <td align="center"> USS</td>
    <td align="center"align="center"> PA </td>
    <td align="center"> INTL </td>

    <td align="center"> FINAL</td>
    <td align="center"> USS</td>
    <td align="center"> PA</td>
    <td align="center">INTL</td>     
</tr>
<TR>DATA HERE</TR>

Answer №2

To merge columns in a table, you must use the colspan attribute. Update your table structure as shown below:

<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tR>    
<td colspan="4" align="center"> <strong>ONE</strong></td> 

<td colspan="4" align="center"><strong> TWO</strong></td>

<td colspan="4" align="center"><strong>THREE</strong></td>
</tR>

<tr>
    <td align="left">Quiz NAME</td>
    <td align="right">FINAL</td>
    <td align="right">USS </td>
    <td align="right">PA </td>
    <td align="right">INTL </td>        
    <td align="right"> FINAL</td>
    <td align="right"> USS</td>
    <td align="right"> PA </td>
    <td align="right"> INTL </td>
    <td align="right"> FINAL</td>
    <td align="right"> USS</td>
    <td align="right"> PA</td>
    <td align="right">INTL</td>     
</tr>
<TR><td colspan="12">DATA HERE</td></TR>

Answer №3

Insert &nbsp;

for instance:

<p>This is a &nbsp;</p>   

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

How to align Material UI's <TextField> component in the middle of a React project

I'm struggling to align two <TextArea> components using material ui and React. Both of them are contained within the same <div> and share the same className. Despite trying to apply the !important rule in CSS, I haven't been able to ...

Concealing a Specific Element with Text using jQuery

Is there a way to conceal the section that includes the element labeled as "Product Tags" on a webpage? ...

What is the best way to ensure that two div elements remain next to each other even when one has a fixed size?

I need to align two divs side by side, regardless of the container width when one div has a fixed size. Here is a snippet of my HTML markup: <div class="container-fluid"> <div class="row"> <div class="item"> <div class="da ...

The children's className attribute can impact the parent element

As I work on creating a card object, I envision it with the className .card that is styled in CSS as follows: .card img{position:absolute; width:150px; height:160px} I want only the images inside my div to overlap each other while not affecting the divs ...

The Challenge with jQuery Nano Scroll

I recently added the jQuery Nano Scroll plugin to my HTML page. However, I am facing an issue where the scrollpane is not visible. When I inspect the div using Chrome, the scrollpane appears. Any suggestions on how to resolve this? Here's a snippet ...

Unable to adjust the canvas size or scale using Fabric.js

Is there a way to display a large canvas as a smaller one for better user interaction without compromising the size of the uploaded canvas later on? I'm currently working with Fabric.js and exploring the Canvas CSS trick that involves setting the widt ...

The MUI Grid design features information displayed on the left side, accompanied by an image placed directly to the right

In the React MUI V5 sample code below, I am creating a profile page layout with details of a person displayed on the left side of the page in label/value format. My question is how to position an "IMAGE" entry (assume it's a 300px x 300px profile ima ...

Implementing pagination within an Angular 11 Mat-table with grouping feature

Encountering an interesting issue with MatTable pagination and grouping simultaneously. I have two components each with a Mat-table featuring Pagination+Grouping. ComponentOne functions smoothly without any issues. When choosing to display 5 elements pe ...

Creating a full-width layout with CSS div

Seeking the most stylish method to create a layout similar to this using divs in IE7 and other modern browsers (Chrome, Firefox, etc). Appreciate your help! ...

What is the best way to format text within the _e() function in WordPress?

As I work on developing a basic plugin, I encountered the following line of code: echo "<p style=\"color:red;\">Please enter a valid email address!</p>"; I aim to make this plugin easy to localize and internationa ...

Attempting to extract only the text content from a specific div using XPath

I am currently facing a challenge in writing a script to extract the title element from a poorly coded webpage. The developer who created this website did not use any classes, only div elements. Below is a snippet of the source code I am trying to scrape: ...

arranging a collection of images based on their values in increasing order

cardShop is a container with various images, each with its own unique ID and value attribute. These values consist of two numbers separated by a comma, such as 2000,500 or 1500,200. My goal is to sort these images in ascending order based on the first numb ...

Creating a unique blur effect on divs using HTML and CSS

Currently working on a website project and facing an issue where I need to apply Gaussian blur within a div. Although opacity can be adjusted, the challenge lies in blurring the text within the div. Seeking assistance for this matter <html> < ...

Combining and removing identical values in JavaScript

I need to sum the price values for duplicated elements in an array. Here is the current array: var products = [["product_1", 6, "hamburger"],["product_2", 10, "cola"],["product_2", 7, "cola"], ["product1", 4, "hamburger"]] This is what I am aiming for: ...

Clicking a button in jQuery will automatically scroll to the far left

I am facing a challenge with my webpage where inline block divs are being appended each time a link is clicked, causing the total width to eventually go off the page (which is intentional). I would like to implement an animated scroll feature that automati ...

How can I create a unique visual effect on the background in frontend development using chipped design techniques?

Creating a static website utilizing React. Description I am looking to incorporate a visual effect into the website pages, similar to the one demonstrated below. visual effect The goal is to design a rectangular background with triangles cut out from it ...

How do I incorporate a jcarousel slider into a thickbox popup using jQuery, HTML, and CSS?

I'm attempting to incorporate a dynamic car carousel slider into a popup that opens with Thickbox. I've made numerous attempts but haven't achieved success yet. It works when called directly in HTML, but doesn't function properly when ...

The back button fails to refresh the page on a website utilizing Ajax technology

Recently, I implemented AJAX on a client's website to introduce some smooth animations for page transitions. When navigating from the homepage of firedogcreative.com to the edit page, and then to one of the work pages, we see a history like this: fir ...

Modifying the color of the tooltip arrow in Bootstrap 4: A step-by-step guide

How can I change the arrow color of the tooltip using Bootstrap 4? Here is my current code: HTML: <div class="tooltip-main" data-toggle="tooltip" data-placement="top" data-original-title="Service fee helps Driveoo run the platform and provide dedicate ...

Is there a way to delete a stylesheet if I only have limited information about the url?

I am attempting to dynamically remove a CSS stylesheet using JavaScript or jQuery. I am aware that the target stylesheet is located within the 'head' element and includes the text 'civicrm.css', however, I do not possess the full URL o ...