728x90 반응형 TD2 [JavaScript] col 태그의 class를 tbody의 td에 동일하게 할당 col 태그의 class를 tbody의 td에도 동일하게 할당해 col 태그에서 적용할 수 없는 text-align 등을 css에서 적용하는 방법 [html] header header header header content 1 content 2 content 3 content 4 content 5 content 6 content 7 content 8 content 9 content 10 content 11 content 12 [css] table, th, td { border: 1px solid #222; } th, td { width: 100px; } .col-2 { text-align: center; } .col-3 { color: red; } [js] window.onload = function().. 2024. 3. 4. [JavaScript] table에서 내용을 title 속성에 자동으로 추가 table 태그 내 td 안의 내용을 td의 title 속성에 자동으로 추가하여 툴팁(tooltip)으로 보여주는 방법 [html] header header header header content 1 content 2 content 3 content 4 content 5 content 6 content 7 content 8 content 9 content 10 content 11 content 12 [css] table, th, td { border: 1px solid #222; } [js] window.onload = function() { // 화면 로딩 후 실행 let tds = document.querySelectorAll('td'); // td 태그 배열로 변수에 할당 tds.forEach((i.. 2024. 1. 24. 이전 1 다음