CSS를 사용하여 테이블의 스타일을 정의할 수 있습니다. 다음 속성은
및 해당 요소의 스타일을 지정하는 데 사용됩니다 -- 테두리
CSS 테두리 속성은 테두리 너비, 테두리 스타일 및 테두리 색상을 정의하는 데 사용됩니다.
- 테두리 축소
이 속성은
캡션 측 속성은 테이블 캡션 상자를 세로로 배치하는 데 사용됩니다.
이 속성은 테이블의 빈 셀 표시를 지정하는 데 사용됩니다.
예시
다음 예는 테이블 스타일을 보여줍니다 -
<!DOCTYPE html> <html> <head> <style> body { font-family: 'Bookman Old Style', serif; } th { letter-spacing: 1.9px; } #one { border-right: thick solid blue; } td { text-align: center; } </style> </head> <body> <h2>Employee List</h2> <div> <table> <tr> <th id="one">Employee</th> <th>Department</th> </tr> <tr> <td>John </td> <td>Marketing</td> </tr> <tr> <td>Brad</td> <td>Finance</td> </tr> <tr> <td>Tim </td> <td>IT</td> </tr> <tr> <td>Steve</td> <td>Operations</td> </tr> </table> </div> </body> </html>
출력
이것은 다음 출력을 제공합니다 -
예시
<!DOCTYPE html> <html> <head> <style> table { float: left; empty-cells: hide; box-shadow: inset 0 0 4px orange; } tr { box-shadow: inset 0 0 10px greenyellow; } td { font-style: italic; box-shadow: inset 0 0 8px red; } table,td { margin: 6px; padding: 6px; border: 1px solid black; } table </style> </head> <body> <table> <caption>Demo Table</caption> <tr> <th>Head 1</th> <th>Head 2</th> <th>Head 3</th> </tr> <tr> <td>demo</td> <td></td> </tr> <tr> <td></td> <td></td> <td>demo</td> </tr> <tr> <td></td> <td>demo</td> <td></td> </tr> </table> </body> </html>
출력
이것은 다음 출력을 제공합니다 -
- C 프로그래밍
- C++
- Redis
- BASH 프로그래밍
- Python
- Java
- 데이터 베이스
- HTML
- JavaScript
- 프로그램 작성
- CSS
- Ruby
- SQL
- IOS
- Android
- MongoDB
- MySQL
- C#
- PHP
- SQL Server