asp:表长文本包装

时间:2017-04-19 06:59:06

标签: css asp.net

下面是我在aspx文件中的代码;

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:Table ID="tblAssump" CssClass="tbl-assump" runat="server">
            <asp:TableHeaderRow>
                <asp:TableHeaderCell CssClass="tbl-top-header">Items</asp:TableHeaderCell>
                <asp:TableHeaderCell CssClass="tbl-top-header">Assumptions and Justifications</asp:TableHeaderCell>
            </asp:TableHeaderRow>
            <asp:TableRow CssClass="tbl-row-assump">
                <asp:TableCell>1</asp:TableCell>
                <asp:TableCell>RBI assessment is based on the HULL RBI Methodology, Doc. No.: GTS-RBI-FSTR-2015-R-002, Rev. 0 which has been approved by CLIENT.</asp:TableCell>
            </asp:TableRow>
            <asp:TableRow CssClass="tbl-row-assump">
                <asp:TableCell>2</asp:TableCell>
                <asp:TableCell>Tagging methodology and rule of thumb:<br />&nbsp;&nbsp;i.&nbsp;From aft to forward - by framing number.<br />&nbsp;ii.&nbsp;From port to starboard - by longitudinal number.<br />iii.&nbsp;From bottom keel to upper deck - by elevation and/or longitudinal<br />&nbsp;&nbsp;&nbsp;&nbsp; number.</asp:TableCell>
            </asp:TableRow>
            <asp:TableRow CssClass="tbl-row-assump">
                <asp:TableCell>3</asp:TableCell>
                <asp:TableCell>Component setup are based on typical type of structural component used for Hull construction. Risk is eing assessed for all possible tagged components (component system, NOT global system).<br /><br />Definition of Lower, Middle and Upper Zone shall reflect client's requirement, if not the appointed consultant shall advise accordingly.</asp:TableCell>
            </asp:TableRow>
        </asp:Table>
    </ContentTemplate>
</asp:UpdatePanel>

这是我的CSS代码;

.div-assump {
    float: left
}

.tbl-row-assump td:nth-child(1){
    vertical-align: middle
}

.tbl-row-assump td:nth-child(2) {
    background-color: red;
    max-width: 500px;
    word-wrap: break-word;
    text-wrap: normal;
    text-align: justify
}

出于某种原因,当我运行aspx文件时,网站结果是这样的;

enter image description here

我的CSS表格有问题吗?

1 个答案:

答案 0 :(得分:0)

使用word-break: break-all;data-style-name的属性,我认为它会起作用。