This saves time in coding and time in maintaining your website. Here's an This is an old thread, but I noticed reading the comments from the OP on other answers that the original goal was apparently to have The code is as follows (and as theazureshadow noted, for earlier browser support, the various vendor prefixes for The tr element does honor the border-radius. Metadata Last modified: Jul 23, 2020 , by MDN contributors You'll also notice that the space between the cells collapse too.If you're familiar with HTML and CSS, you'll probably know about the benefits of CSS classes.

Topic: HTML / CSS Prev|Next Answer: Use the CSS padding & border-spacing property. css: table thead tr:nth-child(1) th { position: sticky; border-top:0; } .table_holder { border-top:1px solid black; } html: padding: table: When applied to table cells (e.g., th and td), creates a buffer between their content and the cell borders. the You can also change the border style to thick, dotted, dashed, or anything that CSS understands. your coworkers to find and share information. Like the hidden keyword, displays no border. col { border-left: solid; border-right: solid } Example 4 The way it looks will depend on the user's browser and you won't be able to change it. Replace the border-top with a border of the same style in a holding DIV. If you remove the border-top from the table header, the table has nothing to collapse, so no space is created to see through to the underlying cells. It does not appear that the current solutions exactly do that. I did have a problem getting this to work when I had background-color applied to the table itself. table { border-top: double; border-bottom: double; border-right: blank } thead, tbody, tfoot { border-top: solid; border-bottom: solid } colgroup { border-right: solid } Example 3.

Teams. site design / logo © 2020 Stack Exchange Inc; user contributions licensed under Apparently it must be on the tr or td elements. Option for Borders is available in Home menu, under font section with the icon of Borders. As we know the table's cellpadding and cellspacing attributes are removed in HTML5.. Q&A for Work. Here's an example of setting the border to only appear at the bottom of each table cell. If so, un-collapsing them should workactually the more pressing matter is to display margin between rows with borders.

The easiest way to add border radius to a table element that accepts border as a property, is doing border radius with overflow: hidden.Thanks for contributing an answer to Stack Overflow! This means it's unclear as to which direction it should curve given a radius.Instead, you can give a border radius to the two lefthand corners of the first TD and the two righthand corners of the last one. theazureshadow's answer is headed in the right direction, but seems to need a bit more. This is a valid way to produce the same effect as table's cellpadding attribute.

If you want rounded corners in IE, you're going to have to use images and strange markup. Hope that helps people!I found that adding border-radius to tables, trs, and tds does not seem to work 100% in the latest versions of Chrome, FF, and IE. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Here's some examples:To the table cells within the table, you need to apply the border code against the individual table cells.In the following example, I've applied a border against the table cells and the table header cells.
It also reduces the possibility of error, helps with download time, and helps keep your code nice and clean. Where developers & technologists share private knowledge with coworkersProgramming & related technical career opportunitiesRight. You can change its color too.