Reputation: 63
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
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.
Upvotes: 1
Reputation: 531
Try using the CSS3 selector for every other row
tr:nth-child(even) {
background: #ccc;
}
Upvotes: 3