How do I format an additional markdown table?

I would like to format a table using markdown extra / html. I would like every other line to have a gray background for readability. Also I would like to set the width of the table. To accomplish the second part, I tried this:

<div style="width:300px">

header 1 | header 2 | header 3
-------- | -------- | --------
row 1    | a        | b
row 2    | c        | d       
row 3    | e        | f        



It didn't work. Any suggestions? Thank.


source to share

2 answers

Try using a CSS3 selector for every other line

tr:nth-child(even) {
    background: #ccc;



I suggest you convert the markup text to HTML, then you apply the css style to the table.

Warning: Markdown syntax does not support tables. You should use a markdown fork that supports additional formatting.

Check out this link



All Articles