안녕하세요 저는 프로그램을 이렇게 표시하고 싶습니다! [여기에 이미지 설명 입력] [1]
이것은 내 자바 스크립트의 레이아웃을 얻기 위해 이것을 사용하는 내 CSS 코드입니다.
/*
styles.css
*/
body{
background-color:#cecece;
color:#fff;
font-family: Arial, Tahoma, Sans-Serif;
font-size:1em;
}
h1{
color:#FF8000;
text-align:center;
}
table{
width:95%;
}
caption{
font-size:1.2em;
margin:10px;
color:#FF8000;
}
th{
width:33.333%;
font-size:1.1em;
text-align:left;
color:steelblue;
}
#output{
position:absolute;
width:50%;
height:70%;
top:15%;
left:25%;
margin:0px;
padding:10px;
font-size:.9em;
background-color:#2E2E2E;
color:ivory;
}
그리고 이것은 출력을 인쇄하는 JavaScript 코드입니다.
var mytable = "<table><caption>Grading Results</caption>";
document.write(mytable);
document.write('<td><tr><th>' + "Student"+'</th><th>' + "Mark!" + '</th><th>'+"Grade" + '</th> </tr></td>');
for(var i = 0; i < markArr.length; i++){
document.write(' <tr><td>'+studentArr[i] + space1+markArr[i] + space1+gradeAwarded[i] + '</td> </th> ');
}
document.write(' </tr>');
document.write('<td>'+ "The Highest mark was : "+max+ ''+'</td> </th>');
document.write('<td>' + "The Lowest mark was : "+min+''+'</td> </th>');
document.write('<td>'+ "The Average mark was : "+average+''+'</td> </th>');
document.write('<td>' + "number A grades : "+A+''+'</td> </th>');
document.write('<td>'+ "number B grades : "+B+''+'</td> </th>');
document.write('<td>'+ "number C grades : "+C+''+'</td> </th>');
document.write('<td>'+ "number F grades : "+F+''+'</td> </th>');
document.write('</table>');
다음을 변경해야합니다.
<br/>
마감 후 바로 두지 마십시오.</th>
<tr>
첫 번째 이전 <th>
과 </tr>
마지막 후</th>
<tr>
for 문 안에 넣고 </tr>
닫기 전에 a를 넣으십시오. }<td>
하고</td>
</table>
for 문의 닫힘} 바로 뒤로 이동편집하다:
다음은 자바 스크립트의 모습입니다.
var mytable = "<table><caption>Grading Results</caption>";
document.write(mytable);
document.write('<tr><th>' + "Student"+'</th><th>' + "Mark!" + '</th><th>'+"Grade" + '</th></tr>');
for (var i = 0; i < markArr.length; i++){
document.write('<tr>');
document.write('<td>' + studentArr[i] + '</td>');
document.write('<td>' + markArr[i] + '</td>');
document.write('<td>' + gradeAwarded[i] + '</td>');
document.write('</tr>');
}
document.write('</table>');
document.write(''+ "The Highest mark was : "+max+ ''+'<br>');
document.write('' + "The Lowest mark was : "+min+''+'<br>');
document.write(''+ "The Average mark was : "+average+''+'<br>');
document.write('' + "number A grades : "+A+''+'<br>');
document.write(''+ "number B grades : "+B+''+'<br>');
document.write(''+ "number C grades : "+C+''+'<br>');
document.write(''+ "number F grades : "+F+''+'<br>');
(참고 : 나는 이것을 테스트하지 않았습니다)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다