Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Could you help me with this wierd table

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #263273
    sythnes
    Participant

    For my school assignment I have to create this table (https://imgur.com/a/YRjTa), using only CSS without changing HTML code.

    Follow this rules:
    last three rows must be aligned right,
    helpful tags (:first-child, :nth-child, border-collapse, text-transform, letter-spacing)

    Code: https://codepen.io/sythnes/pen/RjvYxR
    Final result: https://imgur.com/a/YRjTa

    edit: css code is mine

    #263275
    Beverleyh
    Participant

    Have a think about it. Which of those helpful “tags” (as you call them), might you use to target the last 3 table cells? Then use it to change cell alignment for those cells.

    Hint: only 2 you’ve listed are actually “selectors”. The other 3 are “properties”. Hit Google to reasearch more.

    Unfortunately we can’t give you the exact code because it defeats the object of it being your learning experience. Sorry – we aren’t here to complete your homework for you.

    #263304
    sythnes
    Participant

    Actually there were 10 tasks to do, here you can see a”final prodcut” (http://www2.scptuj.si/~vidovic.blaz1/CssV02/index.html) :)
    Table was only one task, which represents 10% of assignment, i’m still happy with 90%.

    I was playing around with, code below and trying to hit last three rows for like an hour or two and coulnd’t figure it out :c
    .ocene tr:nth-last-child(2),.ocene tr:nth-last-child(1),.ocene tr:nth-last-child(3) {
    background: green;
    }

    i managed to target the whole row with:
    .ocene tr:nth-last-child(2){
    background: green;
    }

    but when i change number 2 to 1 or 3 it doesn’t affect the whole row but only cuple of tds.

    #263309
    Beverleyh
    Participant

    I was playing around with, code below and trying to hit last three rows for like an hour or two and coulnd’t figure it out

    That’s probably your problem. Think again about what it is you actually need to target.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.