Bootstrap覆盖kajiki

时间:2018-01-29 15:42:06

标签: html twitter-bootstrap bootstrap-4

我想覆盖此表:

<table py:attrs="w.attrs" cellpadding="0" cellspacing="1" border="0">
    <thead py:if="w.columns">
        <tr>
            <th py:for="i, col in enumerate(w.columns)"
                class="col_${i}" py:content="col.title"/>
        </tr>
    </thead>
    <tbody>
        <tr py:for="i, row in enumerate(w.value)"
            class="${i%2 and 'odd' or 'even'}">
            <td py:for="col in w.columns"
                align="${col.get_option('align', None)}"
                class="${col.get_option('css_class', None)}"
                py:content="col.get_field(row, displays_on='genshi')"/>
        </tr>
    </tbody>
</table>

使用Bootstrap表(条带表)。 我已经尝试直接编辑标签,但它没有用。 我该怎么办?

1 个答案:

答案 0 :(得分:0)

在Bootstrap 4中,您需要将类table table-striped添加到表中。

这是一个有效的例子:

&#13;
&#13;
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

<table class="table table-striped">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">First</th>
      <th scope="col">Last</th>
      <th scope="col">Handle</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td>Mark</td>
      <td>Apple</td>
      <td>@youtube</td>
    </tr>
    <tr>
      <th scope="row">2</th>
      <td>Jacob</td>
      <td>Orange</td>
      <td>@facebook</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td>Larry</td>
      <td>Banana</td>
      <td>@twitter</td>
    </tr>
  </tbody>
</table>
&#13;
&#13;
&#13;