wicked_pdf / wkhtml - support for css tables using

2019-07-16 00:36发布

Does the wicked_pdf gem/plugin and the underlying wkhtmltopdf provide support for striping of alternating columns using css of tbody, tr.even and the corresponding tr.odd?

I have this in my css file (in the public folder) but its not rendering the colours properly.

table {
width: 90%;
border: 1px solid #999999;
}

th, td {
    padding: 7px 10px 10px 10px;
}

th {
    border-bottom: 2px solid #111111;
    border-top: 1px solid #999999;
    font-size: 90%;
/*  letter-spacing: 0.1em;
*/  text-align: left;
    text-transform: uppercase;  
}

tbody, tr.even {
    background-color: green;
}

tbody, tr.odd {
    background-color: yellow;
}

Currently I get only yellow across all the cells.

Alternating colours in css not rendering

1条回答
贪生不怕死
2楼-- · 2019-07-16 01:07

try

tr.even {
    background-color: green;
}

tr.odd {
    background-color: yellow;
}
查看更多
登录 后发表回答