【问题标题】:Fill a table horiziantally横向填满一张桌子
【发布时间】:2010-07-07 22:45:37
【问题描述】:

说我有一个清单

e.g.

apple
car
bin

我如何让它在表格中水平填充而不是垂直填充,即它在表格中看起来像这样:

apple car bin

我使用的代码只是对整行重复列表的每个条目,代码如下:

<body> 
    <div metal:fill-slot="main">
        <h1>List of Species in the Database</h1>
        <table border="0" width="100%">
            <tr tal:repeat="records container/Query_Species">
                <td tal:content="records/gene_bank_species">Species</td>
                <td tal:content="records/gene_bank_species">Species</td>            
            </tr>
    </div>
</body>

【问题讨论】:

    标签: python html


    【解决方案1】:
    <table border="0" width="100%">
        <tr tal:repeat="records container/Query_Species">
            <td tal:content="records/gene_bank_species">Species</td>
        </tr>
        <tr tal:repeat="records container/Query_Species">
            <td tal:content="records/gene_bank_species">Species</td>            
        </tr>
     </table>
    

    【讨论】:

    • 该列表在一个列中重复了两次
    • 您应该将第一个“物种”替换为“苹果”,将第二个“物种”替换为“汽车”。我想你会明白的
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-15
    • 1970-01-01
    • 2012-05-23
    • 1970-01-01
    • 2017-02-07
    • 2011-11-17
    相关资源
    最近更新 更多