CSS表格中的长文本对齐

时间:2016-04-01 22:28:06

标签: css freemarker

我想将freemarker xml中我的表格的标题文本集中在一起,但这就是:

enter image description here

我的html和CSS如下:

<table class="itemtable" cellspacing="0">
    <thead>
                    <tr>
                        <th class='head' align="center" colspan="1"><span class='title_br'>Unbilled Sales Order</span></th>
                        <th class='head' align="center" colspan="1"><span class='title_br'>Job to Date</span></th>
                        <th class='head' align="center" colspan="1"><span class='title_br'>Open PO's</span></th>
                        <th class='head' align="center" colspan="1"><span class='title_br'>Remaining Bdgt. Est. vs. JTD + POs</span></th>
                    </tr>
                </thead>
</table>




 table {  
                    font-family: sans-serif;
                    font-size: 7pt;
                    margin-top: 10px;
                    table-layout: fixed;
                    width: 100%;
                }

table.itemtable td {
                font-size: 7px;
                width: 8%;
            }
            table.itemtable th.head {
                font-size: 6pt;
                border-style: solid;
                border-color: black;
                border-collapse:collapse;
                border: 1px solid black;
                border-style: solid double solid double ;
            }
span.title_br  {
                font-family: sans-serif;
                font-size: 7pt;
                font-weight: bold;
                text-align: center;
                letter-spacing: 1px;
            }

1 个答案:

答案 0 :(得分:0)

您的图片看起来在代码中的某处有text-align: justify;设置。它不在您发布的代码中,但从图像判断它必须在某个地方。

搜索“justify”并删除该规则(如果找到)。也许它在某个更高级别的模板或类似的地方......