Edgewall Software

Opened 9 years ago

Last modified 9 years ago

#11896 closed defect

Fix Table Cellspacing for Custom Wiki Fields within a Trac Ticket — at Version 6

Reported by: Kristen Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.4
Component: general Version: 1.0.1
Severity: normal Keywords: custom field table cellspacing
Cc: hasienda Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

When adding a table to a custom wiki field in a trac ticket, the spacing between cells appears uneven as more columns are created.

This is different when adding a table to the trac ticket's description textbox.

Example markup that demonstrates the issue:

||=Column1=||=Column2=||=Column3=||

This was discussed in gdiscussion:trac-users:VUOJFTRQtHw.

Change History (8)

by anonymous, 9 years ago

Attachment: table4.png added

by anonymous, 9 years ago

Attachment: table5.png added

comment:1 by Peter Suter, 9 years ago

It seems the CSS rules for #ticket table.properties tr, ... td and ... th should be more specific and only apply to rows and cells of that table (instead of all contained tables), e.g. #ticket table.properties > tbody > tr:

  • trac/htdocs/css/ticket.css

    diff -r 191a0738e04f trac/htdocs/css/ticket.css
    a b  
    8888 table-layout: fixed;
    8989 width: 100%;
    9090}
    91 #ticket table.properties tr { border-bottom: 1px dotted #eed }
    92 #ticket table.properties td, #ticket table.properties th {
     91#ticket table.properties > tbody > tr { border-bottom: 1px dotted #eed }
     92#ticket table.properties > tbody > tr > td, #ticket table.properties > tbody > tr > th {
    9393 font-size: 80%;
    9494 padding: .5em 1em;
    9595 vertical-align: top;
    9696}
    97 #ticket table.properties th {
     97#ticket table.properties > tbody > tr > th {
    9898 color: #663;
    9999 font-weight: normal;
    100100 text-align: left;
    101101 width: 20%;
    102102}
    103 #ticket table.properties th.missing { color: #d3d398; }
    104 #ticket table.properties td { width: 30% }
    105 #ticket table.properties td p:first-child { margin-top: 0 }
    106 #ticket table.properties td p:last-child { margin-bottom: 0 }
     103#ticket table.properties > tbody > tr > th.missing { color: #d3d398; }
     104#ticket table.properties > tbody > tr > td { width: 30% }
     105#ticket table.properties > tbody > tr > td p:first-child { margin-top: 0 }
     106#ticket table.properties > tbody > tr > td p:last-child { margin-bottom: 0 }
    107107#ticket table.properties .description { border-top: 1px solid #dd9 }
    108108
    109109#ticket .description h3 {

comment:2 by Ryan J Ollos, 9 years ago

Milestone: next-stable-1.0.x

Might be a duplicate of #10841, or at least closely related.

in reply to:  2 comment:3 by Peter Suter, 9 years ago

Replying to rjollos:

Might be a duplicate of #10841, or at least closely related.

Good point! It seems this ticket is about the ticket property view, while #10841 is about the same issue in the ticket property editing form.

It would certainly make sense to use the same approach in both cases. (Either > selectors, or new classes on tr, td, th. I don't know which approach is preferable. Writing efficient CSS in 2000 seems to have required avoiding > selectors, but apparently CSS Selector Performance has changed! (For the better) and now "authors should not need to worry about optimizing selectors".)

comment:4 by Ryan J Ollos, 9 years ago

The > selectors result in more concise and readable CSS and HTML markup, so I'd favor that change if performance is not an issue.

comment:5 by Ryan J Ollos, 9 years ago

Cc: Ryan J Ollos removed
Description: modified (diff)
Milestone: next-stable-1.0.x1.0.4
Owner: set to Ryan J Ollos
Status: newassigned

I tested and the changes look good to me. I'll push log:rjollos.git:t11896-table-cellspacing-fix at the start of milestone:1.0.4 if there is no additional feedback.

comment:6 by Ryan J Ollos, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.