2012-01-02 6 views
3

私は縦の列のテーブルを作成しようとしていますHtml縦列のテーブルを作成する

私のコードはどのように実装すべきですか?

<table border="1" cellpadding="5" cellspacing="5" width="100%" style="background  color:white;"> 
<tr> 
    <th >Table header</th> 
    <td>Table cell 1</td> 
    <td>Table cell 2</td> 
</tr> 
</table> 
+0

テーブル内に複数の列を持つ1列または複数行の複数行を探していますか? – Pavan

+0

それを取得しないでください。何が問題なの? – Burntime

+0

複数行の@JQone複数列 –

答えて

5

は、複数の列

で複数の行を取得するには、以下のようなものを試してみてくださいを参照してください。
<table border="1" cellpadding="5" cellspacing="5" width="100%" 
style="background  color:white;">  
<tr> 
    <th>Header Name1</th>  
    <th>Header name2</th>  
</tr>  
<tr>   
    <td>Row 1 Column 1</td> 
    <td>Row 2 Column 2</td>  
</tr>  
<tr>   
    <td>Row 2 Column 1</td> 
    <td>Row 2 Column 2</td>  
</tr>  

</table> 

各行に別のtrタグを追加する必要があります。

1

あなたは<tr>初のセットとしてあなたのテーブルを構築する必要がある複数の垂直列と複数の行を持つテーブルを作成するには、テーブルヘッダーで、このヘッダ内の各<td>は列ヘッダーセルとあります<tr>年代には、このような行は、次のとおりです。

<table border="1" cellpadding="5" cellspacing="5" width="100%" style="background  color:white;"> 
    <tr> 
     <th>Column1</th> 
     <th>Column2</th> 
     <th>Column3</th> 
    </tr> 
    <tr> 
     <td>Row 1 Column 1</td> 
     <td>Row 1 Column 2</td> 
     <td>Row 1 Column 3</td> 
    </tr> 
    <tr> 
     <td>Row 2 Column 1</td> 
     <td>Row 2 Column 2</td> 
     <td>Row 2 Column 3</td> 
    </tr> 
</table> 

このFiddle

関連する問題