html - Dynamic CSS where the number of elements is variable -


Then I have some code that creates a table (although do not use table tags because it will definitely be wrong !) Where each line is once a color that is colored based on the percent it is currently using inline styles as you can see below (using the smart template system).

I want to move these styles into the stylesheet, but I'm not sure how I can make the classes dynamic because I do not know how many rows will ever be.

  & lt; Div class = "fullbar" & gt; & Lt; Div class = "bar" & gt; {If $ per response [all] Restrictions eq 0} & lt; Div class = "innerbar allna" style = "width: 100%;" & Gt; & Amp; Nbsp; All responses n / a & lt; / Div & gt; {Elseif $ reactions [all] .score lt $ stop withLeo} div class = "innerbar shortbar" style = "width: {$ stop below * 10}%;" & Gt; & Amp; Nbsp; Banned - Under $ $ {offholdBelow} & lt; / Div & gt; {Else} {If $ reactions [all] .responses lt 4} & lt; Div class = "innerbar na" style = "width: {$ responses [all] .score * 10}%;" & Gt; & Amp; Nbsp; Two or more responses n / a & lt; / Div & gt; {Else} & lt; Div class = "innerbar" style = "width: {$ responses [all] .score * 10}%;" & Gt; & Lt; / Div & gt; {/ If} {/ if} & lt; / Div & gt; & Lt; Div class = "scale-container-results" & gt; & Lt; Div class = "scaleleft-results" & gt; Completely Disagree & lt; / Div & gt; & Lt; Div class = "scale-scale-result" & gt; Neutral & lt; / Div & gt; & Lt; Div class = "skelewr-result" & gt; Agree fully & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;  

Am I asking for possible and if so how?

I think that you are trying to create a progress bar set the shared properties and dynamic properties There is nothing wrong with using classes for inline style, e.g. A width: 43%; As you are already doing, for the percentage of the progress bar.

It's okay for example how bootstrap is,


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -