20

By default Tables in Github Markdown are rendered with alternate rows highlighted (zebra striped). What is the markdown to disable this feature? The Github markdown documentation for tables does not describe how this is done.

For example, this table has row striping:

enter image description here

The corresponding markdown is:

Key|Value
---|-----
A|B
C|D
E|F
G|H

This question is different from this question which talks about applying colors in markdown. This question relates specifically to the alternating row highlighting in tables.

Phillip Ngan
  • 15,482
  • 8
  • 63
  • 79
  • Possible duplicate of [How to apply Color in markdown](https://stackoverflow.com/questions/35465557/how-to-apply-color-in-markdown) – Waylan May 12 '18 at 02:06
  • 3
    I don't believe this is possible with GitHub's markdown. – ash May 12 '18 at 10:07
  • 4
    Looking at the css, there is only one rule that sets `.markdown-body table tr:nth-child(2n){ background-color:#f6f8fa }` and nothing else that could possibly overwrite it. So I'd say it's a no-go. – Kaiido May 12 '18 at 10:51

2 Answers2

14

It's not possible with CSS, but there is a workaround. Just add an empty row between your rows.

<tr></tr>
David Peters
  • 849
  • 1
  • 9
  • 12
0

As you both asked for a example, here is snippet from a table i am constructing, note the <tr></tr>, this disables zebra striping.

| Description | YAML Path | Type | Values | Example |
| :---------- | :-------- | :--- | :----- | :------ |
| Absolute path to existing media | general/library | String | N/A | `library_path: '/media'` <tr></tr> |
| Daemonised mode | general/daemon_mode | String | 'foreground'\|'background' | `daemon_mode: 'foreground'` <tr></tr> |
binhex
  • 374
  • 4
  • 13