html table formatting

ivor.oconnor's Avatar

ivor.oconnor

16 Jan, 2016 07:40 AM

A simple table like

| header | Line | Here |
| - | - | - |
| some | text | here |
| and | a | second line asdf |
| and | a | third line asdf |

creates html like
`<colgroup>
<col style="text-align:left;"/>
<col style="text-align:left;"/>
<col style="text-align:left;"/>
</colgroup>

<thead>
<tr>
<th style="text-align:left;">header</th>
<th style="text-align:left;">Line</th>
<th style="text-align:left;">Here</th>
</tr>
</thead>

<tbody>
<tr>
<td style="text-align:left;">some</td>
<td style="text-align:left;">text</td>
<td style="text-align:left;">here</td>
</tr>`

which overrides css code like
`th:first-child, td:first-child {
    text-align: right;
}`

Which seems contrary to the documentation on page 36 <blockquote>To set alignment, you can use a colon to designate left or right
alignment, or a colon at each end to designate center alignment, as above. If no colon is present, the default alignment of your
system is selected (left in most cases).</blockquote>

Perhaps I'm not processing it correctly? multimarkdown % --process-html

I'm using MultiMarkdown version 5.0.0
Copyright (c) 2013-2015 Fletcher T. Penney.

Thanks.

  1. 1 Posted by ivor.oconnor on 16 Jan, 2016 08:20 AM

    ivor.oconnor's Avatar

    Standard css that might be used for most tables:
    table {
        border: 1px solid black;
        border-collapse: collapse;
        box-shadow: 0 0 15px 5px rgba(44,82,100,.75);
    }
    th, td {
        border: 1px solid black;
        padding: .2em .7em;
        text-align: right;
    }
    th.left, td.left {
        text-align: left;
    }
    thead, tfoot {
        background-color: aqua;
    }
    tfoot {
        font-weight: bold;
    }
    tbody tr:nth-child(even) {
        background-color: silver;
    }

    /* */
    th:first-child, td:first-child {
        text-align: right;
    }

  2. Support Staff 2 Posted by fletcher on 17 Jan, 2016 07:46 PM

    fletcher's Avatar

    I just pushed a commit to the development branch to reinstate this feature (this was a very old feature from version 2.)

  3. fletcher closed this discussion on 17 Jan, 2016 07:46 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

Recent Discussions

09 Nov, 2018 04:49 PM
09 Nov, 2018 04:46 PM
09 Nov, 2018 04:44 PM
11 Oct, 2018 02:59 AM
22 Apr, 2018 11:04 PM

Recent Articles