Can html replace string?
我想大声告诉你
我想大声告诉你 2017-07-05 10:35:15
0
1
911

Website framework: flask
The background extracts data from the database and passes a parameter to the front end [172.16.101.31, 172.16.101.32, 172.16.101.33]
After the front end obtains the parameters, it displays:


But I need to display it in columns. The current modification method is to replace ',' with '
' when the data is stored in the database, and pass it to Front end and back

It is currently implemented in this way, but the data stored in the database [172.16.101.31<br/>172.16.101.32<br/>172.16.101.33] is a bit too ugly. By modifying Can html achieve this requirement?

我想大声告诉你
我想大声告诉你

reply all(1)
Ty80

Let’s separate it with ,, in the template

<td valign="middle">
    {% for ip in mod[2].split(',') %}
      <p>{{ ip }}</p>
    {% endfor %}
</td>

Test code

>>> from jinja2 import Template
>>> tmpl = """{% for ip in ips.split(',') %} <p>{{ ip }}</p> {% endfor %}"""
>>> t = Template(tmpl)
>>> print t.render({"ips": "127.0.0.1,192.168.1.1"})
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template