Opened 3 years ago

# Option to automatically size the table of task names

Reported by: Owned by: rjollos ChrisNelson normal TracJsGanttPlugin normal 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.

### comment:1 in reply to: ↑ description ; follow-up: ↓ 2 Changed 3 years ago by ChrisNelson

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
if tw > w then w = tw
endfor


I'm not even sure that's possible.

### comment:2 in reply to: ↑ 1 ; follow-up: ↓ 4 Changed 3 years ago by ChrisNelson

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 8 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.

### Modify Ticket

Change Properties