Trying to remove default cell padding

  • I have a wordpress site using the BRANDON theme.
    I use the Scripts n Styles plugin Link

    I have created RAW HTML block, in which I created a table.
    I gave the table a class: `<table class=”t1″ cellpadding=”0″ cellspacing=”0″>
    I then assigned some css to that class:

    .t1 {width:auto; border-spacing: 0;border-collpase:collapse;}
    

    .t1 td{padding:2.7px; border: 1px solid green; color:red;}
    `.t1 tr {padding:0.6px; line-height:1px;}

    No matter what I try, I still have some white space in my cells: live page

    Inspecting the elements in a browser, I am told:

    • Border:1
    • margin:0
    • Padding:2.7

    So… While I seem to have control over my padding, I still can not reduce the cell-height below 60px.

    Any idea what I need to tweak?

  • @admin3scorg
    It looks like what is happening is the “input” field in the 2nd column has a margin of 20px at the bottom – making the whole row tall

    With your code, try adding something like :

    .t1 td input { margin-bottom: 0px; }

    and that should remove the margin on the input field and help the height.

    Please comment back and close ticket if that helps. Thanks!!

  • >>>It looks like what is happening is the “input” field in the 2nd column has a margin of 20px at the bottom – making the whole row tall

    Well spotted!
    Yes that was it, mystery solved. Appreciate you taking the time to lend a hand.

  • Wonderful! Kindly mark this ticket as solved if it is working okay.

  • Hi folks, when you add code to a forum topic, please make sure to enclose it in CODE tags. If the forum formatting goes pear-shaped, please add a MODLOOK tag so someone can edit the post and correct it. Thanks.

  • meta name=”generator” content=”WordPress 4.9.9″

    One other point, it looks like the site in question is actually using the open source WordPress software rather than being hosted here on WordPressdotcom.

    Just to clarify, these support forums assist users of the WordPressdotcom platform. For help with a site using the WordPress software, you’ll want to head over to the support docs and forums at https://wordpress.org/support Cheers!

  • The topic ‘Trying to remove default cell padding’ is closed to new replies.