Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 向django模板表中的特定行添加图标_Python_Css_Django_Icons - Fatal编程技术网

Python 向django模板表中的特定行添加图标

Python 向django模板表中的特定行添加图标,python,css,django,icons,Python,Css,Django,Icons,我正在处理python Django模板,其中有一个表,其列为id、factor a、factor B、factor C。id、系数A、系数B和系数C的值分别为79、0.56、1.1和1.3 html模板的代码如下所示: <table class="table table-bordered"> <thead> <tr> <th class="text-center">id</th> <th c

我正在处理python Django模板,其中有一个表,其列为id、factor a、factor B、factor C。id、系数A、系数B和系数C的值分别为79、0.56、1.1和1.3

html模板的代码如下所示:

<table class="table table-bordered">
  <thead>
    <tr>
      <th class="text-center">id</th>
      <th class="text-center">Factor A</th>
      <th class="text-center">Factor B</th>
      <th class="text-center">Factor C</th>
    </tr>
  </thead>
  <tbody >
    <tr ng-class="{'info':aggregateData.Mode, 'closed':!aggregateData.Open}">
      <td class="text-center">{{aggregateData.id}}</td>
      <td class="text-center">{{aggregateData.factor_a}}</td>
      <td class="text-center">{{aggregateData.factor_b}}</td>
      <td class="text-center">{{aggregateData.factor_c}}</td>
    </tr>
  </tbody>
</table

身份证件
因素A
因子B
因子C
{{aggregateData.id}
{{aggregateData.factor_a}}
{{aggregateData.factor_b}}
{{aggregateData.factor_c}}
试试这个

<table class="table table-bordered">
  <thead>
    <tr>
      <th class="text-center">id</th>
      <th class="text-center">Factor A</th>
      <th class="text-center">Factor B</th>
      <th class="text-center">Factor C</th>
    </tr>
  </thead>
  <tbody >
    <tr ng-class="{'info':aggregateData.Mode, 'closed':!aggregateData.Open}">
      <td class="text-center">{{aggregateData.id}}</td>
      <td class="text-center">{{aggregateData.factor_a}}</td>
      <td class="text-center">{{aggregateData.factor_b}}</td>
      <td class="text-center">{{aggregateData.factor_c}}</td>
      {% if aggregateData.open == True %}
        <td class="text-center">
          <a href="https://www.google.co.in">
            <img src="/path_toicon.png">    
          </a>
        </td>
      {% endif %}
    </tr>
  </tbody>
</table>

身份证件
因素A
因子B
因子C
{{aggregateData.id}
{{aggregateData.factor_a}}
{{aggregateData.factor_b}}
{{aggregateData.factor_c}}
{%if aggregateData.open==True%}
{%endif%}