wicked_pdf / wkhtml - support for css tables using tr.odd and tr.even to change background colour

≯℡__Kan透↙ 提交于 2019-12-24 00:55:35

问题


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.


回答1:


try

tr.even {
    background-color: green;
}

tr.odd {
    background-color: yellow;
}


来源:https://stackoverflow.com/questions/10839778/wicked-pdf-wkhtml-support-for-css-tables-using-tr-odd-and-tr-even-to-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!