Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format markdown extra table?

Tags:

html

markdown

I would like to format a table using using markdown extra / html. I would like every other row to have a grey background for readability. Also I would like to be able 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        

</div>

This did not work. Any suggestions? Thanks.

like image 484
jack Avatar asked Dec 06 '25 05:12

jack


1 Answers

Try using the CSS3 selector for every other row

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

http://jsfiddle.net/6GNCu/

like image 183
dbd Avatar answered Dec 08 '25 04:12

dbd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!