0

html テーブルでは、テキストは IE と chrome で自動的にラップされます。しかし、Firefox ではより多くのスペースが必要であり、ラップされています。下の表を見つけてください。列 1 には大きなテキストがあり、IE と chrome では折り返されて幅が狭くなります。firrefox では同じ幅が広くなります。

<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 に答える