On Aug 2, 1:25 pm, "Michael P. Soulier" <[email protected]>
wrote:
> Hi,
>
> I want to style my html and latex output such that each table header has a
> particular background color, and each row alternates between two colors.
For the HTML case you can use the CSS3 nth-child selector, if your
browser supports it, to get the row colouring.
<html>
<head>
<style>
table {
border: 1px solid black;
}
th {
background-color: #f4c;
}
tr:nth-child(odd) {
background-color: #4cf;
}
tr:nth-child(even) {
background-color: #4fc;
}
td {
padding: 0;
}
</style>
</head>
<body>
<table>
<tr><th>Number</th> <th>Value</th></tr>
<tr><td>Row 1</td> <td>A</td></tr>
<tr><td>Row 2</td> <td>B</td></tr>
<tr><td>Row 3</td> <td>C</td></tr>
<tr><td>Row 4</td> <td>D</td></tr>
<tr><td>Row 5</td> <td>E</td></tr>
</table>
</body>
</html>
Regards
Simon
--
You received this message because you are subscribed to the Google Groups
"sphinx-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sphinx-dev?hl=en.