2014-03-02 51 views
0

嘿傢伙我知道這可能是有史以來最簡單的問題,我甚至沒有一個很大的解釋,只是一個問題......爲什麼heck是第二行顯示與第一行內聯,而不是像其他人一樣在下面?下面的代碼:HTML表格:第二行顯示在第一個旁邊,不低於

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> 

PD:對不起,西班牙我才懶得翻譯,但我的意思是,那些話都不是問題

回答

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> 
+0

您的空行不符合W3C標準。 – Harryman

+0

問題是爲什麼我不得不插入一個空行? – dlvx

1

刪除您的rowspan="2"和你的第二排是在正確的地方。

+0

你能告訴我爲什麼rowspan =「2」影響第二行嗎?也許我對它的工作原理有一個不好的印象 – dlvx

相關問題