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

테이블에 여러 개의 열이있는 하나의 열 또는 여러 행이있는 여러 행을 찾고 있습니까? – 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> 's의이 같은 행은 다음과 같습니다

<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

관련 문제