【问题标题】:Is it possible to add another class to a django-bootstrap-ui template tag是否可以将另一个类添加到 django-bootstrap-ui 模板标签
【发布时间】:2018-07-25 07:02:50
【问题描述】:

在我的 django 项目中,我使用的是django-bootstrap-ui 0.5.1

我在我的settings.pyINSTALLED_APPS 变量中有它,并通过我的requirements.txt 文件安装在我的虚拟环境中。例如,我已经通过使用基本的{% container %} 标签及其子标签{% row %}{% column xs="8" sm="6" md="4" lg="3" %} 确认一切正常。

我的问题是这样的:

如果{% container %} 呈现以下代码:

<div class='container'>
</div>

如何向该 div 添加另一个类,以及 'container',以便输出如下所示:

<div class='container custom-class'>
</div>

我已经阅读了文档,但令人惊讶的是没有看到任何相关内容,这让我觉得答案可能就在我面前,而我只是看不到它。

【问题讨论】:

    标签: django bootstrap-ui


    【解决方案1】:

    与其试图弯曲这个库来做我想做的事,自定义 django-tables2 的 {% render_table %} 函数要容易得多。

    $ pip install django-tables2 并阅读文档here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-02
      • 1970-01-01
      • 1970-01-01
      • 2019-10-02
      • 1970-01-01
      • 2013-09-12
      • 2018-09-12
      相关资源
      最近更新 更多