没有边框的嵌套表格与顶部对齐

时间:2016-10-15 14:20:52

标签: html css

我想将嵌套表格对齐到顶部。但线条不匹配表明事实并非如此。 我认为我从表中消除了所有边框大小,填充,间距,但仍有一些东西阻止它真正的顶部对齐。

display:inline-table;
vertical-align:top;
border-style: dotted;
border-width: 0px;
border-spacing: 0px; /* Removes the cell spacing via CSS */
border-collapse: collapse;  /* no double border where cells touch */
padding: 0px;

enter image description here

MWE: https://jsfiddle.net/n89bsc4g/

1 个答案:

答案 0 :(得分:0)

在写css之初

Reset Css

    html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

结帐jsFiddle