Custom Template - Can I use field to set div width

I’m trying to create a list page with an accompanyng visual reference for time duration.
I have tried using javascript getelementbyid to change the width of the div based on the {{{FIELD_VALUE}}} with no success.
I also tried using basic HTML style=“width: {{{FIELD_VALUE}}}px;” which doesn’t work either.

Is there a better way to do this that acyually work?

I appreciate any advice offered.

style=“width: {{{FIELD_VALUE}}}px;”

Right click on the html element and click Inspect, see if the html is rendered properly.

Vider wrote:

I also tried using basic HTML style=“width: {{{FIELD_VALUE}}}px;” which doesn’t work either.

MichaelG wrote:

style=“width: {{{FIELD_VALUE}}}px;”

Right click on the html element and click Inspect, see if the html is rendered
properly.


How is this different?

Did you get the actual field value during Inpsect? Like: style=“width: 10px;”.

Page gives an error. Nothing to inspect.

Page gives an error

What kind of error? Show the error for further discussion. Also enable debug mode (Tools → Advanced Settings → Debug) to see if you can get more information.