Creating a new class within a table

I would like to move some text within a table upward. The text has its own row. I cannot access the row directly to add/change margins. I thought I could do it by creating a new class for that row. But after I created the class in the HTML file and saved, it didn’t take. The new class was moved and located just before the beginning of the table. Does that mean that you cannot create a new class within a table?

Please show us the HTML and CSS you are using.

1 Like

I just figured out how to select a row for styling:

"tbody > tr:nth-of-type(1) {
margin-top: 0px;
}
I tried changing the margin, but that didn’t work. How can I move that row (or the text in it) closer to the row above? Thanks.

As @TechnoBear said, we need to see your code, both html and css, to give any suggestions. :slight_smile:

Margin has no effect on tbody or rows, but there are workarounds.

See for example:

I found a work-a-round. Thanks.

Was it one of the options in the article I linked to?

Anyway, it would be interesting to learn what work-around you decided on. :slight_smile:

Yes, the margin method. Thanks

No, not at all, a method using margin couldn’t work! :wink:

Thanks anyway.