jack
jack

Reputation: 63

How to format markdown extra table?

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.

Upvotes: 3

Views: 3527

Answers (2)

riofly
riofly

Reputation: 1765

I suggest you to transform markdown text to HTML, then you will apply css style to the table.

Alert: Markdown syntax don't support tables. You will must to use a markdown fork that supports extra formatting.

Look this link

Upvotes: 1

dbd
dbd

Reputation: 531

Try using the CSS3 selector for every other row

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

http://jsfiddle.net/6GNCu/

Upvotes: 3

Related Questions