0

在 html 表格中,文本自动换行在 IE 和 chrome 中。但是 Firefox 它占用了更多空间然后包装了.. Firefox 中的问题是什么...任何想法..?请查找下表。第 1 列有较大的文本,在 IE 和 chrome 中包裹并占用较小的宽度。在 firefox 中同样占用较多的宽度

<table cellspacing="1" cellpadding="1" border="1">
        <thead>
            <tr>
                <th valign="top" align="center" colspan="5">
                    Header Col
                </th>
            </tr>
            <tr>
                <th valign="top" align="center" cell="1" id="c0">
                    Col1
                </th>
                <th valign="top" align="center" cell="2" id="c1">
                    col2
                </th>
                <th valign="top" align="center" cell="3" id="c2">
                    col3
                </th>
                <th valign="top" align="center" cell="4" id="c3">
                    col4
                </th>
                <th valign="top" align="center" cell="5" id="c4">
                    col5
                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td valign="top" align="left" cell="1">
                    <table cellspacing="0" cellpadding="0" border="0" class="deffont" style="width: 100%">
                        <tbody>
                            <tr>
                                <td width="15" valign="top" align="left" style="padding-bottom: 0px; margin: 0px;
                                    padding-left: 0px; padding-right: 0px; height: 100%; padding-top: 0px">
                                </td>
                                <td valign="top" align="left">
                                    <div>
                                        <div>
                                            <b><a></a><b>H-(D)p-ganeshgkdagkalyal-(D)seryl-(D)tryptophanyl-(D)seryl-(D)haninsdj-(D)cyclohexylalanyl-(D)arginyl-(D)arginyl-(D)arginyl-(D)glutaminyl-(D)arginyl-(D)arginine
                                                acetate salt</b><br>
                                                <br>
                                            </b>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
                <td valign="top" align="left" cell="2">
                    &nbsp;
                    <div>
                        <div>
                            <br>
                            <br>
                        </div>
                    </div>
                </td>
                <td valign="top" align="left" cell="3">
                    <div>
                        <div>
                            For test in combination with test and test for the test of test with test.<br>
                            <br>
                        </div>
                    </div>
                </td>
                <td valign="top" align="left" cell="4">
                    <div>
                        <div>
                            <table cellspacing="0" cellpadding="0" border="0" class="deffont">
                                <tbody>
                                    <tr>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b></b>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <br>
                        </div>
                    </div>
                </td>
                <td valign="top" align="left" cell="5">
                    <div>
                        <div>
                            DD: 12/22/11&nbsp;&nbsp;<br>
                        </div>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
4

1 回答 1

0

将此样式添加到您的 TD :style="display: inline-block;word-break: break-all;"

<table cellspacing="1" cellpadding="1" border="1">
        <thead>
            <tr>
                <th valign="top" align="center" colspan="5">
                    Header Col
                </th>
            </tr>
            <tr>
                <th valign="top" align="center" cell="1" id="c0">
                    Col1
                </th>
                <th valign="top" align="center" cell="2" id="c1">
                    col2
                </th>
                <th valign="top" align="center" cell="3" id="c2">
                    col3
                </th>
                <th valign="top" align="center" cell="4" id="c3">
                    col4
                </th>
                <th valign="top" align="center" cell="5" id="c4">
                    col5
                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td valign="top" align="left" cell="1">
                    <table cellspacing="0" cellpadding="0" border="0" class="deffont" style="width: 100%">
                        <tbody>
                            <tr>
                                <td width="15" valign="top" align="left" style="padding-bottom: 0px; margin: 0px;
                                    padding-left: 0px; padding-right: 0px; height: 100%; padding-top: 0px">
                                </td>
                                <td valign="top" align="left" style="display: inline-block;word-break: break-all;">
                                    <div>
                                        <div>
                                            <b><a></a><b>H-(D)p-ganeshgkdagkalyal-(D)seryl-(D)tryptophanyl-(D)seryl-(D)haninsdj-(D)cyclohexylalanyl-(D)arginyl-(D)arginyl-(D)arginyl-(D)glutaminyl-(D)arginyl-(D)arginine
                                                acetate salt</b><br>
                                                <br>
                                            </b>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
                <td valign="top" align="left" cell="2">
                    &nbsp;
                    <div>
                        <div>
                            <br>
                            <br>
                        </div>
                    </div>
                </td>
                <td valign="top" align="left" cell="3">
                    <div>
                        <div>
                            For test in combination with test and test for the test of test with test.<br>
                            <br>
                        </div>
                    </div>
                </td>
                <td valign="top" align="left" cell="4">
                    <div>
                        <div>
                            <table cellspacing="0" cellpadding="0" border="0" class="deffont">
                                <tbody>
                                    <tr>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <b></b>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <br>
                        </div>
                    </div>
                </td>
                <td valign="top" align="left" cell="5">
                    <div>
                        <div>
                            DD: 12/22/11&nbsp;&nbsp;<br>
                        </div>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
于 2013-03-19T07:31:17.703 回答