简体   繁体   English

HTML表和边框对齐

[英]HTML table and border alignement

I'm trying to align two table's borders. 我正在尝试对齐两个桌子的边框。 Please take a look on this small example http://jsfiddle.net/kf82J/2/ 请看一下这个小例子http://jsfiddle.net/kf82J/2/

On Internet Explorer and Chrome, the right border is not aligned, but works on Firefox. 在Internet Explorer和Chrome上,右边框未对齐,但适用于Firefox。

My goal is to be able to draw a line that "aligns" width the middle of the title, it's difficult to explain with words, just check the jsfiddle. 我的目标是能够在标题的中间绘制一条“对齐”宽度的线,用文字很难解释,只需检查jsfiddle。

Same code below 下面的代码相同

<table style="width:100%;border-collapse: collapse;">
    <tr style="height: 10px;">
        <td style="width: 1px;">
        </td>
        <td rowspan="2" style="font-size:19pwhite-space:nowrap;x;width:1px;">
            Title &nbsp; &nbsp;
        </td>
        <td style="height:50%;">
        &nbsp;
        </td>
    </tr>
    <tr style="height: 10px;">
        <td>
        </td>
        <td style="height:50%;border-top: 1px solid black; border-right: 1px solid black;">
        &nbsp;
        </td>
    </tr>
</table>
<table  style="width:100%;border-collapse: collapse;border:1px solid black;border-top:none;">
    <tr>
        <td>Content</td>
    </tr>
</table>

Remove below line from css for table 从表的css中删除下面的行

 border-collapse: collapse;

It worked for me in fiddle. 它在小提琴中适合我。

或者,您可以尝试为第一个表添加透明边框

<table style="border:1px solid transparent;>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM