Modify

Opened 13 years ago

Last modified 11 years ago

#8967 new enhancement

Option to automatically size the table of task names

Reported by: Ryan J Ollos Owned by: Chris Nelson
Priority: normal Component: TracJsGanttPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

Would it be possible to have an option to automatically size the table of task names to fit the largest one? Perhaps lwidth = auto as a syntax for the option.

Attachments (0)

Change History (4)

comment:1 in reply to:  description ; Changed 13 years ago by Chris Nelson

Replying to rjollos:

Would it be possible to have an option to automatically size the table of task names to fit the largest one? Perhaps lwidth = auto as a syntax for the option.

It seems to me this would be really hard. The plugin would have to know the font metrics of your display and do:

w = 0
for each task
   tw=renderedWidth(task.name)
   if tw > w then w = tw
endfor

I'm not even sure that's possible.

comment:2 in reply to:  1 ; Changed 13 years ago by Chris Nelson

Replying to ChrisNelson:

Replying to rjollos:

Would it be possible to have an option to automatically size the table of task names to fit the largest one? Perhaps lwidth = auto as a syntax for the option.

It seems to me this would be really hard. ... I'm not even sure that's possible.

Or maybe I'm dumb. If I left all sizing out of the table and set the style to adjust to cell content, maybe the browser would do the right thing. That might be the right thing to do for all the columns that don't have an explicit width set.

comment:3 Changed 13 years ago by Ryan J Ollos

I don't know anything about JavaScript, so maybe it's a dumb request ;) I'd be happy to test out any ideas you have though.

comment:4 in reply to:  2 Changed 11 years ago by Johannes Rössel <johannes.roessel@…>

Or maybe I'm dumb. If I left all sizing out of the table and set the style to adjust to cell content, maybe the browser would do the right thing. That might be the right thing to do for all the columns that don't have an explicit width set.

Usually table cells scale to their content. I just tried it out in Chrome's Inspector by removing all explicit width=... and it worked. If in doubt one can always use max-width to prevent the column from getting too wide.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Chris Nelson.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.