Modify

Opened 3 years ago

Last modified 14 months ago

#8967 new enhancement

Option to automatically size the table of task names

Reported by: rjollos Owned by: ChrisNelson
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 ; follow-up: Changed 3 years ago by 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. 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 ; follow-up: Changed 3 years ago by ChrisNelson

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 3 years ago by rjollos

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 14 months 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.

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.