Unable to apply border-radius to a specific HTML table

I am facing an issue where the border-radius is not being displayed on a specific HTML table. I am having difficulty in applying rounded corners to the entire table so that the table edges have a 30px curve. Here is an example of what I am looking for:

I have gone through other solutions provided by answered questions, but none of them seem to work with my HTML. What could I be doing wrong?

tbody tr:nth-child(even) {
  background-color: #191919;
 
}
tbody th {
  text-align: left;
}
tbody tr:nth-child(odd) {
  background-color: #2B2B2B;
  color:white;

}
caption {
  font-weight: bold;
  font-size: 24px;
  text-align: left;
  color: #333;
  margin-bottom: 16px;
}
  table {
      border-collapse: collapse;
      text-align: left;
      vertical-align: middle;
      border-radius:30px;
  }
  th, td {
    padding: 8px;
    
  }
  thead th {
    width: 25%;
    
  }
  .headtable{
    flex: 1 1 auto;
    overflow: hidden;
  }
  .shouldertable{
    display: flex;
    align-items: baseline;
    overflow: hidden;
}
.kneetable{
    flex-shrink: 1;
    display: inline-flex;
    overflow: hidden;
    font-family: 'latobold', Arial, sans-serif;
}
.toestable{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-basis: 0;
    box-flex: 1;
    flex-grow: 1;
    flex-shrink: 1;
    text-align: left;
    color: #5f6368;
    empty-cells: show;
}
.nosetable{
    white-space: nowrap;

float: left;
    text-align: left;
  }
  .nosetablesendero{
    white-space: nowrap;
    color: #d9d9d9;
float: left;
    text-align: left;
    margin-top: 10px;
margin-bottom: 10px;
font-size: 20px;
padding-left: 22px;
font-family: 'latolight', Arial, sans-serif;
  }
.sender{
    max-width: 100px;
    padding-right: 32px;
    width: 21%;
 
        max-width: 106px;
        padding-right: 32px;
        width: 29%;
 
}

.tablenotifications{
    width: 100%;

}
.notifications{

  
}
.sentcolo{
    max-width: 0;
    min-width: 0;
}


.border {
    padding: 10px;
    border-color: red;
    border: 1px solid green;
    border-radius: 20px;
    background-color: silver;
  }
<div class="notifications">
   <table class="tablenotifications">
   <tr>
        <td class="headtable sender"><div class="shouldertable"> <span class="kneetablesender"> <span class="nosetablesendero">EXAMPLE</span></span></div> </td>
        <td class="sentcolo"><div class="headtable message"><div class="shouldertable"><div class="kneetable">  TITLE </div><span class="toestable"><span class="nosetable">&nbsp; - &nbsp;</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut  </span></div></div></td>
            
    </tr> 
    <tr>
        <td class="headtable sender"><div class="shouldertable"> <span class="kneetablesender"> <span class="nosetablesendero">EXAMPLE</span></span></div> </td>
        <td class="sentcolo"><div class="headtable message"><div class="shouldertable"><div class="kneetable">  TITLE </div><span class="toestable"><span class="nosetable">&nbsp; - &nbsp;</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut  </span></div></div></td>
            
    </tr> 
    <tr>
        <td class="headtable sender"><div class="shouldertable"> <span class="kneetablesender"> <span class="nosetablesendero">EXAMPLE</span></span></div> </td>
        <td class="sentcolo"><div class="headtable message"><div class="shouldertable"><div class="kneetable">  TITLE </div><span class="toestable"><span class="nosetable">&nbsp; - &nbsp;</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut  </span></div></div></td>
            
    </tr> 
    <tr>
        <td class="headtable sender"><div class="shouldertable"> <span class="kneetablesender"> <span class="nosetablesendero">EXAMPLE</span></span></div> </td>
        <td class="sentcolo"><div class="headtable message"><div class="shouldertable"><div class="kneetable">  TITLE </div><span class="toestable"><span class="nosetable">&nbsp; - &nbsp;</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut  </span></div></div></td>
            
    </tr> 

    </table>
    </div>

Answer №1

To address the issue, apply an overflow: hidden property to the table.

tbody tr:nth-child(even) {
  background-color: #191919;
 
}
tbody th {
  text-align: left;
}
tbody tr:nth-child(odd) {
  background-color: #2B2B2B;
  color:white;

}
caption {
  font-weight: bold;
  font-size: 24px;
  text-align: left;
  color: #333;
  margin-bottom: 16px;
}
table {
      border-collapse: collapse;
      text-align: left;
      vertical-align: middle;
      border-radius:30px;
  }
  th, td {
    padding: 8px;
    
  }
  thead th {
    width: 25%;
    
  }
  .headtable{
    flex: 1 1 auto;
    overflow: hidden;
  }
  .shouldertable{
    display: flex;
    align-items: baseline;
    overflow: hidden;
}
.kneetable{
    flex-shrink: 1;
    display: inline-flex;
    overflow: hidden;
    font-family: 'latobold', Arial, sans-serif;
}
.toestable{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-basis: 0;
    box-flex: 1;
    flex-grow: 1;
    flex-shrink: 1;
    text-align: left;
    color: #5f6368;
    empty-cells: show;
}
.nosetable{
    white-space: nowrap;

float: left;
    text-align: left;
  }
  .nosetablesendero{
    white-space: nowrap;
    color: #d9d9d9;
float: left;
    text-align: left;
    margin-top: 10px;
margin-bottom: 10px;
font-size: 20px;
padding-left: 22px;
font-family: 'latolight', Arial, sans-serif;
  }
.sender{
    max-width: 100px;
    padding-right: 32px;
    width: 21%;
 
        max-width: 106px;
        padding-right: 32px;
        width: 29%;
 
}

.tablenotifications{
    width: 100%;

}
.notifications{
border-radius: 20px;
overflow: hidden;
  
}
.sentcolo{
    max-width: 0;
    min-width: 0;
}


.border {
    padding: 10px;
    border-color: red;
    border: 1px solid green;
    border-radius: 20px;
    background-color: silver;
  }
<div class="notifications">
   <table class="tablenotifications">
   <tr>
        <td class="headtable sender"><div class="shouldertable"> <span class="kneetablesender"> <span class="nosetablesendero">EXAMPLE</span></span></div> </td>
        <td class="sentcolo"><div class="headtable message"><div class="shouldertable"><div class="kneetable">  TITLE </div><span class="toestable"><span class="nosetable">&nbsp; - &nbsp;</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut  </span></div></div></td>
            
    </tr> 
    <tr>
        <td class="headtable sender"><div class="shouldertable"> <span class="kneetablesender"> <span class="nosetablesendero">EXAMPLE</span></span></div> </td>
        <td class="sentcolo"><div class="headtable message"><div class="shouldertable"><div class="kneetable">  TITLE </div><span class="toestable"><span class="nosetable">&nbsp; - &nbsp;</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut  </span></div></div></td>
            
    </tr> 
    <tr>
        <td class="headtable sender"><div class="shouldertable"> <span class="kneetablesender"> <span class="nosetablesendero">EXAMPLE</span></span></div> </td
        <td class="sentcolo"><div class="headtable message"><div class="shouldertable"><div class="kneetable">  TITLE </div><span class="toestable"><span class="nosetable">&nbsp; - &nbsp;</span> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut  </span></div></div></td>
            
    </tr>

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

Enhance your SVG progress circle by simply selecting checkboxes

I have a unique system with 5 checkboxes that act as a To-Do list. When I click on each checkbox, the circle's diameter should progressively fill up in increments of 1/5 until all 5 checkboxes are completed. The order in which the checkboxes are click ...

AngularJS combined with jVectorMap allows for the seamless rendering of small interactive

I am facing a similar issue to one discussed here, but with some minor differences. Initially, my map loaded without any problem on the site. However, after adding Angularjs to the site, I noticed a 'small' map issue. It seems like a simple code ...

How to create a full-page background image using Bootstrap?

Take a look at this example: In the provided example, there is a background landing page that expands to fit the width of the viewport, remains responsive, and does not take up the full width of the page. How can you utilize bootstrap to manually code an ...

Only output to the console if the data returned from an AJAX request has been

Here is a script that I created: <script type="text/javascript> $('.storage').html(""); setInterval(function(){ $.get('./playcommand.php', function(data) { if($('.storage').html() !== data){ ...

What is the best way to retain data after clicking a button?

I am facing an issue where I need to figure out how to add information to a new page when a button is clicked. For example, let's say I have an "add to cart" button and upon clicking it, I want to store some data. How can I achieve this functionality? ...

How can I verify if an SVG file has a reliable source? (having troubles converting SVG to canvas)

While attempting to use an SVG generated by a chart plugin (https://wordpress.org/plugins/visualizer/), I am facing issues retrieving the source of the SVG-image being created. Interestingly, when using other SVGs with the same code, everything works perfe ...

Using PHP to output HTML tags as text

How can I display an HTML tag as text on screen, rather than in code format? I want readers to be able to easily read the tag itself. What is considered the best practice for achieving this? print htmlspecialchars('<meta name="copyright" conten ...

Craft a Flawlessly Repeating Sound Experience - Online

I'm facing a challenge in creating a flawless loop of an audio file. However, all the methods I've tried so far have resulted in a noticeable gap between the end and the start. Here are the approaches I experimented with: The first approach inv ...

Enhance HTML Performance with Resource Preloading

Just a quick query I wanted to throw out there - would prefetching resources like js scripts and images actually slow down the page load time? For instance, let's say I have a page with several links such as: <link rel="prefetch" href="http://exa ...

Tips for altering the appearance of a dropped item using JQueryUI sortable

I have a straightforward website where I need to implement the ability to drag and drop styled DIV elements between two containers. Utilizing JQueryUI's sortable function, this behavior was successfully achieved with the following code: $("#active-co ...

Issue with jQuery: Changes are not being triggered and clicks are also not working

I managed to recreate the modifications of my complex script in a simple jsfiddle, which can be found here. Below is the code I am working with locally: HTML <input type="text" id="rangeStart" value="updateMe" /><br/> <input type="text" c ...

The issue with the CSS background gradient is that it fails to completely cover the entire

Despite attempting several solutions recommended in similar questions, I am still unable to resolve the issue. Using the CSS background gradient generator at Ultimate CSS, I found that the gradient only extends halfway down the page on www.ncentertain.com ...

Is it possible to incorporate Google icons within Freemarker?

https://i.stack.imgur.com/Pv2T4.pngI'm having trouble using Google icons in my project. Can anyone help me figure out how to fix this? UPDATE: Here is a snippet of my HTML template: <?xml version="1.0" encoding="UTF-8"?> < ...

The offspring surpasses the parent's limits and extends beyond its

I am designing a webpage layout that includes 2 navigation bars (top), a top-graphic (middle) flexbox, and a content flexbox (bottom). Within the top-graphic flexbox, I want to add a black box for text. However, I am facing issues with the box overflowing ...

Why do I need to control-click in order to download the link?

Lately, I have been operating a simple node.js server for hosting a website. However, recently, I encountered an issue where one of my download links began redirecting to the index.html page instead of initiating the download process for the PDF it is supp ...

Create engaging text animation by transitioning from horizontally displayed text to vertically displayed text with the letters standing upright using An

I'm trying to create an animation where an acronym is displayed horizontally in the middle of the screen and then flips vertically. The challenge I'm facing is rotating individual letters once they are vertical so that the text reads from top to ...

Unable to render Material Icons on Vue/Quasar web app hosted on Azure

I am facing an issue with my webapp built using Vue and Quasar. I added the necessary icon imports to my quasar-user-options.js file. import '@quasar/extras/material-icons/material-icons.css' import "@quasar/extras/material-icons-outlined/ma ...

Use .load() to set an image as background in the div

There is a block of code that is supposed to display images in a div with the class "img", but it isn't functioning correctly. Can you provide some guidance on how to fix this issue? <div class="other"><a href="/index1.html">Link1</a&g ...

A data table created with Bootstrap is not displayed inline with the pagination feature

Customizing Bootstrap Data Table Code Instructions on how to customize this code: <div class="row"> <div class="col-sm-5"> <div class="dataTables_info" id="example_info" role="status" aria-live="polite"> Showing 1 to 10 of 2 ...

Troubleshooting problem with Laravel and Vue integration

I have experience working on a Laravel and Vue.js project. Here is the code snippet for the Laravel view: @extends('layouts/app') @section('content') <div id="app"> </div> @endsection And here is the ...