- This topic is empty.
-
AuthorPosts
-
August 16, 2017 at 3:04 am #259199
DRandall
ParticipantHello,
I am trying to add a border radius element to specific tables on my website (round out the corners) but am not sure how. All examples I can find online show you how to add the border radius to the main TABLE .TR .TD section, but I don’t want the settings to apply to EVERY table on my page. I want to be able to call a class of some sort, so I can apply individual border radius settings (per quadrant) on a one-by-one table basis.
Thank you in advance for your help.
August 16, 2017 at 3:09 am #259202Paulie_D
MemberI want to be able to call a class of some sort, so I can apply individual border radius settings (per quadrant) on a one-by-one table basis.
So what have you tried?
This would probably required 5 classes or more…or you could try something like this
August 16, 2017 at 3:11 am #259204DRandall
ParticipantI’m not trying to collapse a table, I’m just new to CSS and don’t know the syntax for adding a class to an individual table (or cell) itself.
August 16, 2017 at 3:50 am #259205Paulie_D
MemberThe same way you add a class to anything…in the HTML
<table class="myclass"> etcAugust 16, 2017 at 3:50 am #259206DRandall
ParticipantHere is something recent I have tried:
table.comment td {
border-bottom-left-radius: 8px;
}and then in one of my table cells, assigning the class like this:
But this does not result in the table cell inheriting any kind of style.
I have tried giving the style to the table itself (not the td) and this does work, but it gives every
in the table the style and this is not what I want. I want to be able to give specific table cells the style. Thanks. August 16, 2017 at 3:51 am #259207DRandall
ParticipantSorry, the missing code should be:
August 16, 2017 at 3:52 am #259208DRandall
ParticipantHm, don’t know why the sample html isn’t showing up, but it’s just td class = “comment”
August 16, 2017 at 4:00 am #259209JeroenR
ParticipantYour CSS selector is
table.comment td
, so that expects a class ‘comment’ on your table element.
What you describe is a class ‘comment’ on the table-cell, therefore your selector should betable td.comment
.August 16, 2017 at 4:00 am #259210August 16, 2017 at 4:05 am #259211DRandall
ParticipantAwesome, thank you. :)
-
AuthorPosts
- The forum ‘Design’ is closed to new topics and replies.