wicked_pdf/wkhtml - 支持使用 tr.odd 和 tr.even 更改背景颜色的 css 表 [英] wicked_pdf / wkhtml - support for css tables using tr.odd and tr.even to change background colour
本文介绍了wicked_pdf/wkhtml - 支持使用 tr.odd 和 tr.even 更改背景颜色的 css 表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
wicked_pdf gem/plugin 和底层 wkhtmltopdf 是否支持使用 tbody、tr.even 和相应的 tr.odd 的 css 对交替列进行条带化?
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?
我的 css 文件中有这个(在公共文件夹中),但它没有正确呈现颜色.
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.
推荐答案
try
tr.even {
background-color: green;
}
tr.odd {
background-color: yellow;
}
这篇关于wicked_pdf/wkhtml - 支持使用 tr.odd 和 tr.even 更改背景颜色的 css 表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文