document.write 써서 테이블 만들었는데 이거css로 적용이 안돼네요 따로 방법이 없을까요?
되는데 안된다고 하시니.. 코드를 올려보세요
댓글을 작성하려면 로그인이 필요합니다.
JS 다시 FM으로 공부해 보세요. ^!~
https://homzzang.com/b/js
답변을 작성하려면 로그인이 필요합니다.
이 게시물을 신고 하시겠습니까?신고사유를 선택해주세요.
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<style>
table {
border: 1px solid black;
}
</style>
<input type="text" id="a">
<input type="text" id="b">
<button onclick="btn()">클릭</button>
<script>
function btn() {
var x = document
.getElementById('a')
.value;
var y = document
.getElementById('b')
.value;
document.write("<table>");
document.write("<tr>");
document.write("<td>");
document.write(x);
document.write("</td>");
document.write("<td>");
document.write(y);
document.write("</td>");
document.write("</tr>");
document.write("</table>");
}
</script>
</body>
</html>