HTML:如果单元格中不适合单词,如何用空格分隔单词以换行?

时间:2020-03-25 13:38:26

标签: html css odoo qweb

我正在Odoo Qweb中做一些动态表。
我使表格具有表格布局:固定;边界折叠:折叠,宽度:100%;
我想知道为什么“ 4 Colin Desmarets”不会像“ 3 Colin Company”那样破裂?
我尝试了很多可用的CSS样式,但无法获得pdf和html格式的结果。
enter image description here

这是我的scss:

.table-main-report-dn {
width: 100%;
border-collapse: collapse;
table-layout: fixed;

tr, td {
    border: 1px solid black;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

td {
    padding: 4px;
}

td.name {
    width: 17%;
}

td.name-intra {
    width: 35%;
}

td.company {
    width: 33%;
}

td.birthday {
    height: 20%;
}

td.title {
    height: 44px;
    background-color: #EDEEE1;
}

td.text-title {
    vertical-align: baseline;
    text-align: center;
}

tr.main {
    td {
        height: 65px;
    }
}

td.main-info {
    height: 150px !important;
}

}

这是我的xml代码:

<tr t-foreach="o.participant_ids" t-as="participant" class="main">
                        <td>
                            <b><t t-esc="count"/>&#160;<t t-esc="participant.lastname"/>&#160;<t t-esc="participant.firstname"/>
                            </b>
                        </td>
                        <td>
                            <t t-esc="participant.parent_id.name"/>
                        </td>
                        <td>
                            <t t-if="participant.birth" t-esc="participant.birth.strftime('%d/%m/%Y')"/>
                        </td>
                        <t t-foreach="range(o.session_id.seance_count)" t-as="d">
                            <td></td>
                        </t>
                        <t t-set="count" t-value="count+1"/>
                    </tr>

你能帮我吗?

1 个答案:

答案 0 :(得分:1)

如何避免不间断空格(&#160;)?

<t t-esc="count + ' ' + participant.lastname + ' ' + participant.firstname"/>
相关问题