TIL 02 [HTML] 테이블(표)

9004 단어 htmlTablesTILTIL

TABLES

  • th : table heading
  • tr : table row
  • td : table data

rowspan, colspan 속성

  • rowspan="(숫자)" 행 합치기
  • colspan="(숫자)" 열 합치기
  • <td> 안에 들어가지요!!
  • *span: 걸치다

scope 속성

  • scope="row" 행 제목 / scope="col" 열 제목
  • <th>안에 들어갑니당!!
  • *scope: 범위

😀 표를 만들어보자..

제목1 제목2 제목3
제목A 1행 1열 1행 2열 1,2행 3열
제목B 2행 1열 2행 2열
합계 어마어마어마어마어마한 숫자
<table>
  <thead>
    <tr>
      <th></th>
      <th scope="col">제목1</th>
      <th scope="col">제목2</th>
      <th scope="col">제목3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">제목A</th>
      <td>1행 1열</td>
      <td>1행 2열</td>
      <td rowspan="2">1,2행 3열</td>
    </tr>
    <tr>
      <th scope="row">제목B</th>
      <td>2행 1열</td>
      <td>2행 2열</td>
    </tr>
  </tbody>
  <tfoot>
    <tr>
      <th>합계</th>
      <td colspan="3">어마어마어마어마어마한 숫자</td>
    </tr>
  </tfoot>
<table>

Q. 작성할 때는 표가 제대로 보이는데 왜 출판하면 깨지는지..

좋은 웹페이지 즐겨찾기