Edgewall Software

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#11896 closed defect (fixed)

Fix Table Cellspacing for Custom Wiki Fields within a Trac Ticket

Reported by: Kristen Owned by: Peter Suter
Priority: normal Milestone: 1.0.4
Component: general Version: 1.0.1
Severity: normal Keywords: custom field table cellspacing
Cc: hasienda Branch:
Release Notes:

Fixed styling of tables in textarea ticket custom fields.

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:


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

Attachments (2)

table4.png (2.7 KB ) - added by anonymous 7 years ago.
table5.png (2.8 KB ) - added by anonymous 7 years ago.

Download all attachments as: .zip

Change History (10)

by anonymous, 7 years ago

Attachment: table4.png added

by anonymous, 7 years ago

Attachment: table5.png added

comment:1 by Peter Suter, 7 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%;
    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;
    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%;
    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 }
    109109#ticket .description h3 {

comment:2 by Ryan J Ollos, 7 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, 7 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, 7 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, 7 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, 7 years ago

Description: modified (diff)

comment:7 by Ryan J Ollos, 7 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 1.0-stable in [13662:13663], merged to trunk in [13664:13665].

comment:8 by Ryan J Ollos, 7 years ago

Owner: changed from Ryan J Ollos to Peter Suter

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Peter Suter.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Peter Suter to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.