Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Elegant use of the CSS padding property

Elegant use of the CSS padding property

Scheduled Pinned Locked Moved Web Development
cssquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jesarg
    wrote on last edited by
    #1

    I'm working on making tables look nice in CSS, but I'm running into some difficulties: If I do

    td.TD2
    {
    padding:5px;
    }

    then I get a class for a single cell with the padding space that I want. However, applying the padding property to a tr class or a table class appears to do nothing. Anyway, I'd rather not specify a new class for every single td on the page. Is there an elegant way to make the padding property work for an entire table?

    J 1 Reply Last reply
    0
    • J jesarg

      I'm working on making tables look nice in CSS, but I'm running into some difficulties: If I do

      td.TD2
      {
      padding:5px;
      }

      then I get a class for a single cell with the padding space that I want. However, applying the padding property to a tr class or a table class appears to do nothing. Anyway, I'd rather not specify a new class for every single td on the page. Is there an elegant way to make the padding property work for an entire table?

      J Offline
      J Offline
      jesarg
      wrote on last edited by
      #2

      table.T2 td
      {
      padding:5px;
      }

      Funny how I tend to figure out the answer to my own question the second after finally resorting to posting on the forum.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups