Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8097481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:46:29+00:00 2026-06-05T21:46:29+00:00

I have following CSS: table tbody tr:last-child td { padding-top: 7px; border-bottom: 0; }

  • 0

I have following CSS:

table tbody tr:last-child td {
  padding-top: 7px;
  border-bottom: 0;
}

table tbody tr:first-child td {
  padding-top: 6px;
}

Now I may have a table with just one row.
The only table row is now assigned to first-child instead of last-child, but I want it to be the other way around.

Is there a way without Javascript?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:46:31+00:00Added an answer on June 5, 2026 at 9:46 pm

    This can’t be. You must have some mistake in your markup. If it really is the only tr, both last AND first will match.

    See example

    However, which CSS will be applied depends on the order of you css-rules. So you can determine whether padding-top: 7px; or padding-top: 6px; shall applie by placing the rules accordingly.

    edit:

    as your problem is caused by a plugin, which inserts a row automatically at the end, you can simply use :nth-last-child(2) to match the second-last element.
    (Note however that Browser-support for nth-last-child is slightly worse than last-child)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following CSS: #numpad table td { padding: 6px; text-align:center; width:80px; height:80px;
I have the following html files: <html> <head> <style type=text/css> .table-striped { padding: 0;
I have the following style in an external CSS file called first.css table {
I have a table with the following CSS rules applied: table { border-collapse: collapse;
I have the following CSS code .editable:before { content: url(../images/icons/icon1.png); padding-right:5px; } this is
I have the following CSS and HTML: .TestPadding{ width:29px; text-align:center; height:18px; padding:3px 0px 2px
I have the following code, thanks to another SO question/answer: page = agent.page.search(table tbody
I have the following CSS style code for my table: table { table-layout: fixed;
I have the following css code .container { width:800px; background-color:yellow; margin:auto; display:table; } .cell
I have following html <table> <th>Name</th><th>age</th> <tbody> <tr><td>A</td><td>25</td></tr> <tr><td>B</td><td>30</td></tr> <tr><td>C</td><td>34</td></tr> <tr><td>D</td><td>32</td></tr> </tbody> </table> I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.