In Trac, is it possible to add "text-decoration: line-through" as a custom __style__?
I'm getting Trac 0.12.1 set up for the first time, and have written a few custom report queries.
However, I am having difficulty getting the custom __style__
macro thingy (described in the docs here) to display a text-decoration: line-through;
style. It doesn't show up at all.
My query is roughly the following:
SELECT p.value AS __color__,
(CASE status WHEN 'closed' THEN 'text-decoration: line-through' END)
AS __style__,
id AS ticket, priority, summary, version
FROM ticket t
LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
ORDER BY version DESC, id DESC
This does not display closed tickets with line-through. I can see it in the rendered page source, it is correctly formatted in the style=""
attribute tag, as such:
</tr>
<tr class="color1-even" style="text-decoration: line-through;">
<td class="ticket">
However, changing line 2 in the query above to rea开发者_StackOverflowd:
(CASE status WHEN 'closed' THEN 'color: #666; background: #ccc' END)
It actually does show the row color and background as changing to a medium-gray color, so the style is definitely working.
Is anyone familiar enough with Trac to say why this may not be working, and provide a workaround? Strike-through really helps to distinguish closed/invalid tickets.
It may be that text-decoration:line-through
doesn't work across tr
tags; if that is the case, is there a way to apply the Trac __style__
only on one column (having it only on the summary
would be fine.)
Thank you in advance.
I tested out the following minimal HTML document:
<html><body>
<table border=1>
<tr><th>Col 1</th><th>Col 2</th></tr>
<tr><td>Data 1</td><td>Data 2</td></tr>
<tr style="text-decoration: line-through;"><td>Data 3</td><td>Data 4</td></tr>
</table>
</body></html>
The results were as expected (in both Firefox and IE). The text in the last row had a line running through it. I don't think having text-decoration: line-through;
inside a <tr>
element is your problem here.
Make sure that there isn't anything in any of your style sheets that might be overriding your inline CSS. Try using text-decoration: line-through !important
to override any other styles that may be present. If this changes the behavior, then your problem is being caused by a conflicting definition in one of the style sheets.
精彩评论