Getting Table Closer to Heading

josephavellino's Avatar

josephavellino

23 Sep, 2014 06:16 PM

Good day. I am using the following css. H4 works in Write to get tables closer (decrease the space) to the header. The HTML preview works in Write, but it isn't working in Marked. I am hoping you can look at my naive css and suggest what I can do to decrease the space between a header - I am using H4 - and the tables I create (I use the <tr> table syntax).

Thanks in advance.

body {
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 15px;
    width: 75%;
    text-align: left;
    border: 0px;
    padding: 0;
    margin: 60px auto 100px;
    background:#ffffff;
    word-wrap: break-word;
}

img {
    max-width:90%;
}

h1 {
color: #000000;
font-size: 18px;
font-weight: 700;
}

h2 {
color: #000000;
font-size: 16px;
font-style: normal;
font-weight: 700;
}

h3 {
font-size: 16px;
font-weight: 600;
}

h4 {
font-size: 15px;
font-weight: 600;
font-style: normal;
        margin-bottom: -20;
}

h5 {
    font-size: 15px;
font-style: normal;
font-weight: 400;
line-height: 7px;
}

h6 {
font-size: 15px;
font-weight: bold;
line-height: 7px;
}

hr {
    height: 0.2em;
    border: 0;
    color: #CCCCCC;
    background-color: #CCCCCC;
}

p, ul, ol, dl, li, table, pre {
margin: 15px 0;
line-height: 27px;
}

table {
    border-collapse: collapse;
    margin: 20px 0 0;
    padding: 0;
}

table tr {
    border-top: 1px solid #ccc;
    background-color: #f8f8f8;
    margin: 0;
    padding: 0;
}

table tr:nth-child(2n) {
    background-color: #f8f8f8;
}

table tr th,
table tr td {
    border: 1px solid #ccc;
    text-align: left;
    margin: 0;
    padding: 6px 13px;
}

blockquote {
    margin-left: 1em;
    padding-left: 1em;
    border-left: 1px solid #ddd;
}

a, a:visited {
    color: #4183C4;
    background-color: inherit;
    text-decoration: none;
}

#message {
    border-radius: 6px;
    border: 1px solid #ccc;
    display:block;
    width:100%;
    height:60px;
    margin:6px 0px;
}

button, #ws {
    font-size: 10pt;
    padding: 4px 6px;
    border-radius: 5px;
    border: 1px solid #bbb;
    background-color: #eee;
}

code, pre, #ws, #message {
    font-family: Monaco;
    font-size: 10pt;
    border-radius: 3px;
    background-color: #F8F8F8;
    color: inherit;
}

code {
    border: 1px solid #EAEAEA;
    margin: 0 2px;
    padding: 0 5px;
}

pre {
    border: 1px solid #CCCCCC;
    overflow: auto;
    padding: 4px 8px;
}

pre > code {
    border: 0;
    margin: 0;
    padding: 0;
}

#ws {
    background-color: #f8f8f8;
}

.send {
    color:#77bb77;
}

.server {
    color:#7799bb;
}

.error {
    color:#AA0000;
}

  1. 1 Posted by josephavellino on 23 Sep, 2014 07:42 PM

    josephavellino's Avatar

    Never mind. I'm a dummy. -20px certainly works better than -20.

    Sorry for the wasted cycles. Please close this and burn it to destroy the evidence. :)

  2. Support Staff 2 Posted by Brett on 23 Sep, 2014 07:57 PM

    Brett's Avatar

    Actually,

    table {
        border-collapse: collapse;
        margin: 20px 0 0;
        padding: 0;
    }
    

    You have a 20px margin on top of your table. Modify that and you'll get it as close as you want (set margin:0, padding:0 on the h4 for best results).

  3. 3 Posted by josephavellino on 23 Sep, 2014 08:17 PM

    josephavellino's Avatar

    Thanks!

  4. Brett closed this discussion on 25 Sep, 2014 12:30 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac