What could be the reason behind the vanishing border of a cell in a Bootstrap4 table when I apply a rowspan to a column?

Here is the code snippet I am working with:

       <table width="100%" class="table-bordered">
            <tbody>
                <tr>
                    <td class="font-weight-bold text-center px-1">Sr. No</td>
                    <td class="font-weight-bold text-center px-1">Item No</td>
                    <td class="font-weight-bold text-center px-1">Item Details</td>
                    <td class="font-weight-bold text-center px-1" colspan="4">Instructions</td>
                </tr>
                <tr>
                    <td class="text-center px-1" rowspan="5">1</td>
                    <td class="text-center px-1 border" rowspan="5">1</td>
                    <td class="text-center px-1">Personal Details</td>
                    <td class="px-1" colspan="4">
                        <ul style="list-style: lower-roman;" class="m-0">
                            <li>This Form is applicable to Resident Indians and there is a separate Form for Non Resident Indians.</li>
                            <li>Currently, Foreign Nationals / Other Country Individuals (OCI) and Persons of Indian Origin (PIO) are not allowed to open PRAN.</li>
                            <li>The applicant shall mention father’s name and mother’s name and shall select the option to be printed on PRAN Card.</li>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td class="text-center px-1">Spouse Name</td>
                    <td class="px-1" colspan="4">If married, spouse name is mandatory.</td>
                </tr>
                <tr>
                    <td class="text-center px-1">Father's Name</td>
                    <td class="px-1" colspan="4">
                        <ul style="list-style: lower-roman;" class="m-0">
                            <li>Father’s name is mandatory.</li>
                            <li>If father’s name has more than 30 digits, you may fill Annexure II for the same.</li>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td class="text-center px-1">Mother's Name</td>
                    <td class="px-1" colspan="4"&...

The display result of the above code can be seen in this image: https://i.sstatic.net/4OHgi.png

When using a `colspan`, it seems that the border disappears. Attempting to change `border-collapse` to `separate` helped slightly but created double lines in some areas and single lines elsewhere. Any suggestions or ideas on how to fix this issue?

Answer №1

Upon review :

rowspan="16" & rowspan="17" should ideally be rowspan="3" :) – G-Cyrillus

No modifications unfortunately – on3ss

To achieve coherent code structure :

   <td class="text-center px-1" rowspan="17">...</td>
   <td class="text-center px-1& lt;strong<>17</ strong<>>..</td>
   < td class= "text-center-px-1" rowspan= "16" > ... </ td>

it is suggested that (& Ii don't see that many rows below)

   < td class = "text-center-pix 1" rowspan = "3"& gt; ... </ td>
   < td class = "text-center-px-1" rowspan = "3"& gt; (...) </td, [! - & gt;; ] pseudo-code completely lost composure so movin...

to ensure alignment with other contained rows and cells without overflow ....

Demonstration of successful implementation :

html {
  border: none; padding: unset;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" />
<table width="100%" class="table-bordered">
  <tbody>
    <tr>
      <td class="font-weight-bold text-center px-1">Sr. No</td>
      <td class="font-weight-bold text-center px-1">Item No</td>
      <td class="font-weight-bold text-center px-1">Item Details</td>
      <td class="font-weight-bold text-center px-1" colspan="4">Instructions</td>
    </tr>
    <tr>
      <td class="text-center px-1" rowspan="5">1</td>
      <td class="text-center px-1 border" rowspan="5">1</td>
      <td class="text-center px-1">Personal Details</td>
      <td class="px-1" colspan="4">
        <ul style="list-style: lower-roman;" class="m-0">
          <li>This Form is applicable to Resident Indians and there is a separate Form for Non Resident Indians.</li>
          <li>Currently, Foreign Nationals / Other Country Individuals (OCI) and Persons of Indian Origin (PIO) are not allowed to open PRAN.</li>
          <li>The applicant shall mention father’s name and mother’s name and shall select the option to be printed on PRAN Card.</li>
        </ul>
      </td>
    </tr>
    <tr>
      <td class="text-center px-1">Spouse Name</td>
      <td class="px-1" colspan="4">If married, spouse name is mandatory.</td>
    </tr>
    <tr>
      <td class="text-center px-1">Father's Name</td>
      <td class="px-1" colspan="4">
        <ul style="list-style: lower-roman;" class="m-0">
          <li>Father’s name is mandatory.</li>
          <li>If father’s name has more than 30 digits, you may fill Annexure II for the same.</li>
        </ul>
      </td>
    </tr>
    <tr>
      <td class="text-center px-1">Mother's Name</td>
      <td class="px-1" colspan="4">
        <ul style="list-style: lower-roman;" class="m-0">
          <li>Mother's name is mandatory.</li>
          <li>If mother’s name has more...[TRUNCATED]

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

Restrict the hide/show functionality on a div to only operate within its specific radio group, without impacting the other radio groups within the form

I created a form with 3 radio groups that show different sets of divs based on the selection made. The issue I'm facing is that the current code hides radio content divs across all 3 radio groups. How can I fix this? My goal is to display all "Yes" c ...

I'm currently facing an issue with toggling the visibility of a div using JavaScript

In my attempt to create a unique custom select menu using html, css, and javascript, I encountered an issue with toggling the display style of the div containing the options when clicking on the button (in this case, an arrow). HTML: <ul class="de ...

Capturing the Clicked Element's Value in Uib Pagination without Scroll to Top

For my project, I am utilizing uib pagination. I have successfully implemented a feature that allows the page to scroll to the top when a link is clicked. However, I am facing an issue where the page scrolls to the top when clicking on '...'. How ...

What methods are available to incorporate arithmetic when defining a style attribute?

Is there a way to achieve arithmetic operations in CSS, like calculating margin-left: -60px + 50% of the width of the parent div? I'm eager to find a solution, whether it involves JavaScript or any other method. Any help would be greatly appreciated. ...

Disappear Image Overlay when Mouse Hovers

Currently, I am in the process of working on a new webpage. You can view the progress at the following link: . When hovering over the Referrals Button, a Background Overlay will appear. To enhance the visual effect, I am looking to implement a gradual appe ...

5 horizontal navbar with dropdown menu in Bootstrap

I am currently utilizing bootstrap 5. Is it possible to display my navbar menus horizontally like the image provided? show submenus horizontally as shown in this picture I would also like to implement submenu for other submenus up to 4 levels deep. Any ...

There is a slight misalignment when trying to horizontally center a character within a div

I've experimented with various methods like using a px width or em widths. I've attempted nesting a span and trying different styles such as text-align:center or margin:0 auto. I can manage to center either the R or the S, but struggling to get ...

Tips for switching out images depending on the time of day

Currently, I have a script that dynamically changes the background color of my webpage based on the time of day. However, I am facing issues trying to implement a similar functionality for replacing an image source. The current code is also time zone-based ...

Create a stunning MUI App bar with a blurred effect below a fixed Navbar

Is there a method to apply a blur effect to the background of my material-ui AppBar component, creating a visually appealing overlay below the fixed navbar? I have experimented with using filter: blur(0) but it does not achieve the desired result. I am lo ...

What is the technique for rearranging columns to be at the top in Foundation for mobile devices?

On my desktop, I have a layout like this: [Column1 large-8] [Column2 large-4] For mobile view, I'd like it to be like this: [Column2 large-4] [Column1 large-8] Below is the code snippet I am working with: <div id="search-content" class="row ma ...

Eliminate Bootstrap's validation glyphs

Issue Description I am attempting to eliminate the validation icons from Bootstrap, such as the "x" and "check" symbols. Despite my efforts to search thoroughly, I have been unable to locate where these icons are located in the code. Code Sample You can ...

Resizing a column to match the dimensions of a grid of pictures

Imagine you have a website structured like this. #left_column { width: 200px; } <div id="left_column"> /* some content */ </div> <div id="right_column"> /* A series of photos each with a width of 100px and floated */ </div> In t ...

Changing the designated materialUI class

Within the project, I am utilizing this theme: export const theme = createMuiTheme({ ...defaultThemeConfig, overrides: { ...defaultThemeConfig.overrides, MuiListItem: { root: { '&:nth-child(odd)': { backgro ...

Utilizing the "::first-letter" pseudo element selector in conjunction with the MuiButton class in Material UI - What is the process?

Is it possible to change the text case of Button text inside Material UI Button to sentence case with CSS? https://mui.com/components/buttons/ The text inside the button - ADD FRIEND should be transformed to sentence case as Add friend. I attempted to o ...

Having trouble aligning my slider in the center

Despite trying various methods to center this slider, such as using align="center" and different margin styles on the images and slider div itself, I am still facing alignment issues. Any assistance would be greatly appreciated. This is my first time posti ...

Utilizing 'this' in jQuery: Image swapping with thumbnails, Twitter Bootstrap framework

Is it possible for jQuery's 'this' to simplify my code? You can view the full code here. Thank you for any help or suggestions. Here is the jQuery code: /* Ref: http://api.jquery.com/hover/ Calling $( selector ).hover( handlerIn, handler ...

Firefox throwing XML parsing error when SVG is encoded as data URI

Check out my codepen demo showcasing the issue: codepen.io/acusti/pen/mJmVRy Encountering an error when trying to load svg content in Firefox: XML Parsing Error: unclosed token Location: data:image/svg+xml;utf8,<svg%20viewBox='0%200%20120%2 ...

Insert straight lines between elements in an inline list

I am working on building a step progress bar using the HTML code below: .fa-check-circle { color: #5EB4FF; } .fa-circle { color: #CFD7E6; font-size: 14px; } .container { width: 100%; position: absolute; z-index: 1; margin-top: 20px; } . ...

Shift the content downwards within an 'a' snippet located in the sidebar when it reaches the edge of the right border

I'm having an issue with my style.css file. As a beginner in programming, I am trying to position text next to an image attached in the sidebar. However, the text is overflowing past the border. Here's the HTML code: Please see this first to ide ...

What is the method for adding color to the select and option fields?

On my website, I have created a contact form and I am trying to customize the select field by adding colors like other fields. However, when I choose an option from the select field, it is not showing up. Can you please help me identify what mistake I migh ...