Tips for preventing tables from breaking their borders when the page is being split?

I am looking to enhance the design of my website by incorporating CSS borders on cards displayed in columns of 3. However, I want to ensure that the cards are not split between columns. Below is an excerpt from my CSS code:

<style>
.card {
    border-style: ridge;
    border-width: 3px;
}
.card-deck{
    -webkit-column-count: 3;
     overflow-wrap: break-word;   
}
</style>

View Cutted Cards Example

How can I prevent the cards from being split between columns?

Answer №1

Implement the following CSS rule to prevent breaking inside a .card element:

.card {
    border-style: ridge;
    border-width: 3px;
    break-inside: avoid;
}

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

Adding a CSS class to a LinkButton upon clicking in an ASP.NET application

Let's say I have 3 link buttons on a webpage, <asp:LinkButton ID="LB1" runat="server" CssClass="regular" OnClick="LB1_Click"> Today </asp:LinkButton> <asp:LinkButton ID="LB2" runat="server" CssClass="regular" OnClick="LB2_Click"> ...

Adjust the width of a DIV based on the content of other DIVs, and float and center them all

Initially, what seemed like a simple task has turned out to be more complicated than I anticipated. Here is my code: <html> <head> <style> div { border-top: 1px solid black; margin: 10px; } div#all { border: 0; } </style> <body ...

What is the purpose of sending an OPTIONS request to the server?

When making a request using jQuery.ajax, I follow this simple method: $.ajax({ type: "GET", url: serviceUrl + '/GetAgentsGroupNameById', contentType: "application/json; charset=utf-8", data: { id: agentsGroupI ...

Alignment of button within bootstrap column is skewed when screen size is reduced

My button is perfectly centered in one of my bootstrap columns, but things start to get messy when the screen size shrinks and the button overlaps with another column containing text. Adjusting the margins only seems to make things weirder. .center-btn- ...

Using an Ember color picker to dynamically change SCSS variables

Is there a way to allow an admin to change the skin of one of my websites by selecting a color from a palette that will update a universal SASS variable? I am aware of methods to dynamically change CSS using jQuery, but I specifically want to modify the S ...

React - Next Blog: Issue with empty lines displaying on the browser

Currently, I am developing a blog that retrieves data from Mongo Atlas. The blog is built using Next.js version 9.5.4 and is hosted on Vercel. The blog page utilizes static props and regeneration. The data is fetched in JSON format and then stringified fo ...

What is the best way to achieve two columns of the same height, with the right column nested inside the left column?

Is there a way to create two equal height columns with the right column inside the left column using pure CSS? I have explored different methods, but due to the lack of a parent selector in CSS, I haven't been successful so far. My goal is to have ex ...

Having issues with your Array not functioning properly? In need of assistance?

Encountering trouble loading a map, but it functions when certain variables are deleted. Using this as a prototype and aiming to enhance it further, however, the priority is to ensure that the map works initially. Deleting some of the variables in places ...

Is there a way to customize the navbar layout so that link 1 is aligned to the right side, link 2 is centered, and link 3 is positioned on the right?

I attempted to utilize the flex property and justify content, but unfortunately that did not yield the desired result. I experimented with the code provided below. The goal is to create a website layout with a logo at the top and a navigation bar directly ...

How can a method inside an object property of the same class be invoked in JavaScript?

I'm faced with a bit of confusion here. I have a class property called hotspot of type object, declared as follows: Cannon.prototype.hotspot = {stuff: this.blah(...) }; The method blah() is actually a prototype of the same 'class': Canno ...

What is the protocol for displaying linear gradients that overlap?

My objective is to create a unique cutting corner effect using linear gradients. Achieving this on one corner is straightforward: body { background: #eac996; } .box { width: 100px; height: 100px; margin: 100px auto; padding: 20px; backgroun ...

How can I ensure my webpage displays properly on different devices using HTML?

I have been trying to make my code responsive by adding media queries, but I am struggling to get it to work with the current setup. I even attempted setting the width to 100%, but still facing issues. I would really appreciate a simple explanation on how ...

How can I create a design that blends half image and half color together with intricate cutting techniques?

Can someone give me tips on creating a design like this? I attempted to use bootstrap to create it, but I was unsuccessful due to my lack of knowledge on how to achieve this specific background. Any guidance on the proper way to design it would be greatly ...

What is the best way to divide data using [/ -]?

I am trying to split a string that shows a date. The date is shown in the format dd/mm/yyyy or dd-mm-yyyy. This is my code (the current string is formatted as mm/dd/yyyy): <input type="data" id="dat"> ..... var dataString=$('#dat').val(); ...

Choosing containers as found in the Firefox debugging tool

I'm currently working on developing a container selector similar to the one found in Firefox's debug tools (press ctrlshift+C). The main goal is to retrieve a list of selected elements for further manipulation. Here is my current progress: http ...

What is the counterpart of `width: max(100%, fit-content)`?

In order for my div to adjust its size based on the content if the parent div is smaller than the content, and match the size of the parent otherwise, I have been trying to achieve the first scenario by using width: fit-content, and the second scenar ...

Changing the class of a div element in a jQuery array or JSON object with a click event

I am trying to create a function where clicking on a div adds its child's class to either a JQuery array or a JSON object. Clicking on the div again should remove the class from the array. Multiple divs should be able to be "selected" and deselected. ...

Issues with Angular's http get functionality not functioning as expected

I'm experimenting with an API on apiary.io and attempting to retrieve data from it using Angular, but I'm encountering issues with the call. The setup seems straightforward, so I'm not quite sure what's causing the problem: HTML: < ...

Utilizing ASP.NET AJAX: Enhancing User Experience with ScriptManagerProxy for HTML Button Click Events

I am currently working on a solution for the following issue: Managing the client-side click event of a button - preventing postback if the JavaScript call returns false (e.g. onclick="js:return IsThisAllowed()") The JavaScript method will either return ...

Enlarged text size disrupts alignment of ul menu items

After creating a fixed menu using unordered lists and extensive CSS, I added a custom class button that redirects back to the frontpage. However, I noticed an extra pixel of height in the menu causing alignment issues with the buttons. The big button stick ...