Computer >> 컴퓨터 >  >> 프로그램 작성 >> HTML

HTML에서 표 바닥글을 만드는 방법은 무엇입니까?


HTML 태그는 표에 바닥글을 추가하는 데 사용됩니다. 태그는 tbody 와 함께 사용됩니다. 태그 및 머리 표의 각 부분(머리글, 바닥글, 본문)을 결정하는 태그입니다.

다음은 속성입니다 -

속성

설명
정렬
오른쪽
왼쪽
센터
신이 옳다고 하다

사용 중단 - 시각적 정렬.
문자
문자
사용 중단 − 텍스트를 정렬할 문자를 지정합니다. align ="char"일 때 사용
문자열
픽셀 또는 %
사용 중단 - char 속성으로 지정된 첫 번째 문자에 대한 정렬 오프셋(픽셀 또는 백분율 값)을 지정합니다. align ="char"일 때 사용
정렬
상단
가운데
맨 아래
기준선
지원 중단 - 수직 정렬.

예시

HTML에서 표 바닥글을 생성하기 위해 다음 코드를 실행할 수 있습니다 -

<!DOCTYPE html>
<html>
   <head>
      <style>
         table, td {
            border: 1px solid black;
         }
      </style>
   </head>
   
   <body>
      <table style = "width:100%">
         <thead>
            <tr>
               <td colspan = "4">This is the head of the table</td>
            </tr>
         </thead>
         <tfoot>
            <tr>
               <td colspan = "4">This is the footer of the table</td>
            </tr>
         </tfoot>
         <tbody>
            <tr>
            <td>Cell 1</td>
            <td>Cell 2</td>
            <td>Cell 3</td>
            <td>Cell 4</td>
            </tr>

            <tr>
               ...more rows here containing four cells...
            </tr>
         </tbody>
         
         <tbody>
            <tr>
               <td>Cell 1</td>
               <td>Cell 2</td>
               <td>Cell 3</td>
               <td>Cell 4</td>
            </tr>
           
            <tr>
               ...more rows here containing four cells...
            </tr>
         </tbody>
      </table>
   </body>
</html>