WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Reduce padding inside WP tables (4 posts)

  1. LRigel
    Member
    Posted 1 year ago #

    Hey, First time poster. Using the Asteroid theme. Real simple issue - how do I reduce upper/lower padding inside tables? I'm local, so here's a screen -
    http://oi45.tinypic.com/2i0cigl.jpg

    So again, I would like to reduce inside table padding and the space between lines of text (if possible) so I don't waste very much space.
    Reducing table height does not seem to work. Here is a sample code of my tables, inside a div

    <div style="float: right; margin: 0 1px 1px 0;">
    <table width="320" cellspacing="0" cellpadding="0">
    <tbody>
    <tr style="background-color: #404040;">
    <td style="text-align: center;"><span style="color: #ffffff;">Table Title</span></td>
    </tr>
    <tr>
    <td><span style="font-size: 11px;">Text with lower table height
    </span></td>
    </tr>
    </tbody>
    </table>
    </div>
  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Unfortunately, it's very hard to help with CSS issues without seeing a live page. Try using Firebug (or other browser tool) to work with CSS issues like this. This may also be helpful: http://www.w3schools.com/css/css_table.asp

    BTW, you also should only use tables for data - not layouts and all CSS should be in an external stylesheet - not in the HTML code...

  3. LRigel
    Member
    Posted 1 year ago #

    Thanks. Basically I'm looking a way to override the default cellspacing/cellpadding values. I guess I'll look into it some more. I didn't think it would be a problem mixing HTML and CSS (I thought that since WP supports both of them, why not mess around).

  4. LRigel
    Member
    Posted 1 year ago #

    In the end I've figured it out. Apparently, it had nothing to do with my table.

    I added <div style="line-height: 1.0em;"> to my container div, which I also listed in my original post. It lowered the space between text lines. So the div containing all of my tables now looks like this-

    <div style="line-height: 1.0em; float: right; margin: 2px 2px 2px 2px;">
    </div>

    It seemed to have fixed the issue.

Topic Closed

This topic has been closed to new replies.

About this Topic