小编use*_*110的帖子

将输入值应用于其所有td innerhtml

是否可以在内部输入时更改所有td的innerhtml,我的意思是获取输入的值并将其应用于它的td innerhtml,例如,这里是表及其输入内部:

<table>
 <tr>
  <td><input value="test" /></td>
  <td>123</td>
 </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

把它改成这个:

<table>
 <tr>
  <td>test</td>
  <td>123</td>
 </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

对于所有td和输入值而不应用id和类?!请注意td innerhtml没有改变:)谢谢大家的帮助!;)

javascript jquery html-table input innerhtml

3
推荐指数
1
解决办法
1587
查看次数

如何计算列总和

我之前问过这样的问题,但没有得到任何好的答案,可能是因为代码太长或我的问题不清楚.这个时候我会尽我所能:)到目前为止,我已经编写了代码来从表中查找行和,这很好:

<cfloop list="#product_id_list#" index="product_index">
    <cfloop list="#month_list#" index="month_index">
        <cfoutput query="GET_SALES_TOTAL">
            <cfif AY eq month_index and product_id eq product_index>
                <cfloop list="#type_index#" index="tt_index">
                    <cfset 'alan_#tt_index#_#month_index#_#product_index#' = evaluate(tt_index)>
                </cfloop>
            </cfif>
        </cfoutput>
    </cfloop>
</cfloop>
<cfset 'total_#ii_index#_#p_index#'=evaluate('total_#ii_index#_#p_index#') + #evaluate('alan_#ii_index#_#ddd_other#_#p_index#')#>
Run Code Online (Sandbox Code Playgroud)

现在我想找一个列总和.列总和的代码有效,但不正确.它计算最后一个产品的总和:

<cfloop list="#product_id_list#" index="product_index">
    <cfloop list="#month_list#" index="month_index">
        <cfoutput query="GET_SALES_TOTAL">
            <cfif AY eq month_index and product_id eq product_index>
                <cfloop list="#type_index#" index="tt_index">
                    <cfset 'alan2_#tt_index#_#month_index#_#product_index#' = evaluate(tt_index)>
                </cfloop>
            </cfif>
        </cfoutput>
    </cfloop>
</cfloop>
<cfset 'total2_#ddd_other#_#p_index#'=evaluate('total2_#ddd_other#_#p_index#') + #evaluate('alan2_#ii_index#_#ddd_other#_#p_index#')#>
Run Code Online (Sandbox Code Playgroud)

行和的输出:

<cfloop list="#product_id_list#" index="p_index">
    <cfloop list="#type_index#" index="kk_ind">
        <td align="center">
          <font color="##FF0000">#TLFormat(evaluate('total_#kk_ind#_#p_index#'),0)#</font>
        </td> 
    </cfloop>
</cfloop> …
Run Code Online (Sandbox Code Playgroud)

coldfusion row sum cfml

1
推荐指数
1
解决办法
5586
查看次数

标签 统计

cfml ×1

coldfusion ×1

html-table ×1

innerhtml ×1

input ×1

javascript ×1

jquery ×1

row ×1

sum ×1