HTML表格:第二行显示在第一行旁边,而不是下面

时间:2014-03-02 17:58:50

标签: html html-table row

为什么第二行显示内联第一行而不是其他内容?这是代码:

http://jsfiddle.net/jdelva/9MfGf/4/

<body>
<table id="mitabla" >
    <caption>
        <span class="titulo">Tabla de posiciones campeonato nacional</span>
    </caption>
    <tr class="encabezado">
        <th rowspan="2" colspan="2"> #</th>
        <th rowspan="2" colspan="2"> /\</th>
        <th rowspan="2" colspan="8"> Equipo</th>
        <th rowspan="2" colspan="2"> PJ</th>
        <th rowspan="2" colspan="2"> PG</th>
        <th rowspan="2" colspan="2"> PE</th>
        <th rowspan="2" colspan="2"> PP</th>
        <th rowspan="2" colspan="2"> GF</th>
        <th rowspan="2" colspan="2"> GC</th>
        <th rowspan="2" colspan="2"> DG</th>
        <th rowspan="2" colspan="2"> Pt</th>
    </tr>
    <tr class="equipo">
        <td>1</td>
    </tr>
    <tr class="equipo">
        <td>2</td>
    </tr>
    <tr class="equipo">
        <td>3</td>
    </tr>



</table>
</body>
PS:抱歉西班牙语我懒得翻译它,但我的意思是,这些话不是问题

2 个答案:

答案 0 :(得分:1)

尝试在第一行后插入空行

<body>
<table id="mitabla" >
<caption>
    <span class="titulo">Tabla de posiciones campeonato nacional</span>
</caption>
<tr class="encabezado">
    <th rowspan="2" colspan="2"> #</th>
    <th rowspan="2" colspan="2"> /\</th>
    <th rowspan="2" colspan="8"> Equipo</th>
    <th rowspan="2" colspan="2"> PJ</th>
    <th rowspan="2" colspan="2"> PG</th>
    <th rowspan="2" colspan="2"> PE</th>
    <th rowspan="2" colspan="2"> PP</th>
    <th rowspan="2" colspan="2"> GF</th>
    <th rowspan="2" colspan="2"> GC</th>
    <th rowspan="2" colspan="2"> DG</th>
    <th rowspan="2" colspan="2"> Pt</th>
</tr>
<tr></tr>
<tr class="equipo">
    <td>1</td>
</tr>
<tr class="equipo">
    <td>2</td>
</tr>
<tr class="equipo">
    <td>3</td>
</tr>

答案 1 :(得分:1)

删除rowspan="2",第二行位于正确的位置。