What is the best way to make a border line that runs continuously around a table?

I am currently working on an HTML table and I need to create continuous lines for different rows while keeping the first row separate. The challenge is to connect the lines with blue circles without affecting the top row which serves as the header. Is there a way to achieve this?Check out the fiddle for the HTML and CSS code.


    <table id="table">
        <tr>
            <td>ENTERPRISE</td>
            <td>PRIMARY VARIABLES</td>
            <td>SECONDARY VARIABLES</td>
        </tr>
        <tr>
            <td>Labor Market</td>
            <td>N/A</td>
            <td>Both events had an excellent attendance from C-level executives, with the CFO Forum having its highest attendance rate so far.</td>
        </tr>
        <tr>
            <td>Economic Diversification</td>
            <td>recently hosted two of its flagship events in Hong Kong, the INED Forum and CBA Forum.</td>
            <td>For further information on previous INED and CFO events, please click here to access the Pursuits Resource Centre.</td>
        </tr>
        <tr>
            <td>Innovation and R&D</td>
            <td>He has vast experience working with insurance audit clients, and will be working on two global accounts.</td>
            <td>Sandy specialises in tax, and brings vast knowledge with her in terms of asset management and private equity</td>
        </tr>
    </table>

#table tr:first-of-type td{
    font-size: 18pt;
    color: rgb(0,37,122);
    background-color: rgb(152,198,234);
    text-align: center;
    font-family: "Arial Bold";
    height: 18px;
}
#table tr:not(:first-of-type){
    font-family: "Arial Regular";
    font-size: 14pt;
    color: rgb(51,51,51);
}
td{
    padding-top: 18px;/*2.3653%*/
    padding-bottom: 18px;
    padding-right: 57px; /*3.5625%*/
    border-style:none none solid none;
}
tr td:last-of-type{
    padding-right: 0;
}

Answer №1

#table {
    border-spacing:0
} 

Here is the solution you're looking for:

Answer №2

Make sure to include the cellspacing attribute within the table element.

<table id="myTable" cellspacing="5">

Check out this live demo http://example.com/mydemo/

Answer №3

#table{
  border-spacing: 0; 
  border-collapse: separate; 
}

border-spacing css attribute is essential for spacing between cell borders.

The border-spacing characteristic determines the gap between neighboring cell borders.

A functional JSFiddle example has been included for reference.

Answer №4

If you want to eliminate borders from a table, you can achieve this by adding the following CSS code:

table {
    border-collapse: collapse;
}

Check out this updated JSFiddle

For more information on why it's recommended to use border-collapse over border-spacing, take a look at this resource

Answer №5

Try increasing the thickness of your td border until it becomes blurred! This technique worked effectively for me.


table td{
   border: 2px solid black;
}

If needed, you can also make the transparent lines thinner by setting them to 1px.

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

jQuery allows you to hide a div when the mouse leaves it

HTML <div class="container"> <div class="section" id="block1">Section-1</div> <div class="section" id="block2">Section-2</div> <div class="section" id="block3">Section-3</div> <div class="sectio ...

Display a PDF in a <div> when the menu is clicked

I have a project where I am trying to load a PDF in the middle of my page, inside a div, upon clicking on buttons in a side menu located on the left. While I have been successful in loading the PDF in the div, I am facing issues with triggering this action ...

How can jQuery be used to target a specific class based on its inner value?

For instance, within a div of the same class, there are 6 "p" tags - some containing 'member' text and others not. I aim to use jQuery to select all "p" tags with 'member' as their inner text and apply an additional class to them. Here ...

I'm searching for the HTML5 specifications and information on which browsers support specific features. Can you point me in the right direction

Where can I locate the HTML5 specifications for Internet Explorer, Opera, Firefox, and Google Chrome browsers? ...

Utilizing Angular UI's directives as attributes

Can I utilize Angular UI directives as attributes or classes instead of elements? For example: <ul class="accordion"> <li class="accordion-group"> my content </li> </ul> ...

When using jquery.hide() and show(), the content within the div disappears momentarily before reappearing

Hello! I am experiencing an issue where the content of my div disappears after using a jQuery hide() and show() function. It seems to be gone. <li class="gg3"><a class="link" href="#" data-rel="content3">Link1</a></li> <div clas ...

Experiencing issues with my site's display due to unwanted code plaguing the

I am currently using the latest Divi theme on my WordPress site, and it is in maintenance mode. Recently, I noticed a strange space between the header and the top of the page that only appears on Chrome and IE, but not on Firefox. After inspecting with dev ...

Instructions for implementing tooltips on a pie chart slice when hovering with the mouse pointer, using the canvas

var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); var cw = canvas.width; var ch = canvas.height; ctx.lineWidth = 2; ctx.font = '14px verdana'; var PI2 = Math.PI * 2; var myColor = ["Gr ...

What is the best way to position the logo on the left side and the navigation on the right

How can I position my logo to the left of the navigation bar? This is my current HTML code: <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <link rel="icon" type="image/png" href="SENCOR_Logo.ico"> & ...

What is the best way to incorporate a style attribute into my EJS page content?

Having trouble with adding custom style. It seems to work, but there's an error displayed. Apologies for my poor english :( <div class="card card_applicant"> <div class="card_title" style="background-c ...

Dynamic Dropdown Menu Using PHP and jQuery

I was trying to implement a tutorial I found on this website for a car-related project, but I encountered an issue. The tutorial was working fine, but I needed to add a 'Go' button to allow users to view the selected car from the drop-down menu. ...

Collapsed Grid System

Is it possible to create a CSS grid system that meets the following requirements: The grid should have arbitrary height (with consistent width) and when a grid overflows, it should stack vertically underneath the preceding grid, regardless of other grid ...

What sets apart +variable+ and ${variable} in JavaScript?

Just starting to code and eager to learn. While I was taking in a lecture, I came across this interesting snippet of code: var coworkers = ['go', 'hello', 'hi', 'doit']; <script type="text/javascript&q ...

Conceal the scrollable content beneath a stationary transparent header, allowing the background to

Imagine having a background image, fixed header with transparent areas, a content div with semi-transparent background, and dynamic height in a traditional header/content/footer layout. The desired effect is to have the background and content scroll under ...

Turn off the custom CSS section in the WordPress Customizer for WordPress themes

Looking for assistance in locking or disabling the Appearance -> Customizer -> Additional CSS area on Wp-admin. https://i.sstatic.net/FXXSE.png I have referred to this codex: https://codex.wordpress.org/Theme_Customization_API. However, I couldn&ap ...

Flexbox: Distribute remaining space evenly while allowing content to wrap

Is there a method to instruct flexbox items to occupy the available space while wrapping as soon as they become smaller than their content? However, some items have a fixed width percentage. HTML <div class="grid"> <div class="grid__item"> ...

Tips for showcasing the button label on a different page upon clicking the button

I need help with a functionality where the name of a button clicked on one page is displayed on another page. Here's an example: <a href="#" class="btn btn-danger btn-lg btn-block"> <?php echo $sql->name; ?></a> Currently, echo ...

Modifying the onclick function of an HTML select element - easy steps!

I have customized the click event on my select tag to trigger a specific action. However, when I click on the select tag, the default option list is also displayed. I want to bypass this default behavior and only execute my custom action when the select ta ...

What is the best way to delete the twbs directory from my Laravel project?

I am struggling to incorporate twbs into my Laravel project. How can I remove this folder? https://i.sstatic.net/vaITB.jpg composer.json { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel ...

Tips for Showing Certain Slides When the Page Loads

When using jQuery filter effects to organize div slides on a page, I encountered an issue where all the divs containing different slides are displayed on page load instead of just the default chosen ['active'] div. The filter effect itself is fun ...