1

我有一个 html,我希望一个特定的单元格与左对齐。下面是代码和小提琴链接。

HTML:

 <section class="tr_chapter">
            <div class="chapter"><a name="HKWBV1_ORD_89"></a>
                <div class="toc">
                    <div class="toc-part">
                        <table class="toc-div">
                            <tbody>
                                <tr>
                                    <td>
                                        <table class="toc-item-third-level">
                                            <tbody>
                                                <tr>
                                                    <td></td>
                                                    <td class="toc-item-num-left"><span class="font-style-bold">Contents</span></td>
                                                    <td class="toc-title"></td>
                                                    <td class="toc-pg"><span class="font-style-italic">para.</span></td>
                                                </tr>
                                                <tr>
                                                    <td>4/0/1</td>                                                  <td class="toc-item-num-left">1.</td>
                                                    <td class="toc-title">Companies (O.4, r.2)</td>
                                                    <td class="toc-pg"><a href="4/2">4/2</a></td>
                                                </tr>
                                                <tr>
                                                    <td></td>
                                                    <td class="toc-item-num-left">2.</td>
                                                    <td class="toc-title">Consolidation, etc., of causes or matters (O.4, r.9)</td>
                                                        <td class="toc-pg"><a href="4/9">4/9</a></td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                </div>

</section>

我想要下图中给出的输出。即数字(4/0/1)。请让我知道我该怎么做。

小提琴

谢谢在此处输入图像描述

4

1 回答 1

3

如果您希望编号为 4/0/1 的单元格左对齐,只需给align="left"父 td 或添加一个类text-align:left;

参见:jsfiddle

于 2013-10-25T11:31:04.983 回答