Grow your CSS skills. Land your dream job.

CSS Outline in tables?

  • # December 6, 2009 at 7:09 pm

    Hi all,

    I’m trying to add an outline to a table, but it doesn’t work. I thought it might be because tables were not block elements (or that’s what I remember) I added a display:block to it, and the outline appeared, but everything was messesed up. So how do I go about adding an outline to the table?

    Thanks!

    # December 6, 2009 at 10:07 pm

    I would try giving it a border instead of an outline.

    If I’m not mistaken you can apply borders to <table>s and <tr>s.

    # December 6, 2009 at 10:21 pm

    I’m trying to make the 2px pop technique, but w/o images or extra markup, so I already used the border to make the dark shade, so I was planning to use outline to make the white shade, but it didn’t work.

    # December 6, 2009 at 10:59 pm

    Might just need to wrap it in a DIV with another border…

    # December 6, 2009 at 11:18 pm

    Hmmm… Yea. Tables are "display:table" so outline won’t really work for it…

    You can assign borders to the Table cells… not that that helps…

    Sounds like additional markup is the answer.

    # December 8, 2009 at 3:19 pm

    Yeah, that’s what I wanted to avoid. But there seem to be no other option. Thanks all for your help :) At least I’ll wrap the table with JS to keep my markup :P

    # December 8, 2009 at 3:44 pm
    "JorgeLainfiesta" wrote:
    At least I’ll wrap the table with JS to keep my markup :P

    Lol, why? That’s got to create much more lag than couple extra characters of HTML.

    Are you afraid of Div-itis Police?

    # December 8, 2009 at 3:52 pm
    "AshtonSanders" wrote:
    "JorgeLainfiesta" wrote:
    At least I’ll wrap the table with JS to keep my markup :P

    Lol, why? That’s got to create much more lag than couple extra characters of HTML.

    Are you afraid of Div-itis Police?

    Well, not actually. The design is for a board script, so I’d have to edit tons and tons of templates to make all tables I want to give the effect wrapped into another div xD

    # December 8, 2009 at 4:11 pm

    I see. That makes sense.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".