2013-03-07 2 views
1

아래의 HTML 페이지에 1 개의 기본 테이블에 2 개의 2 개의 테이블이 있습니다. HTML 행 간격이 잘못되었습니다.

<%-- 
    Document : P2 
    Created on : Mar 7, 2013, 1:19:55 PM 
    Author  : u0138039 
--%> 
<!DOCTYPE html> 
<html> 
    <head> 
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
     <title>JSP Page</title> 
    </head> 
    <body> 
     <form name="form1" method="post" action=""> 
      <table width="722"> 
      <tr> 
       <td width="334"> 
       <table width="255" > 
       <tr> 
        <td width="128"><p>PARTS Updated&#13;</p></td> 
        <td width="111"><label for="PARTS_Updated"></label> 
        <select name="PARTS_Updated" id="PARTS_Updated" > 
         <option value=""></option> 
         <option value="N/A">N/A</option> 
        </select></td> 
       </tr> 
       <tr> 
        <td><p>TSI OK&#13;</p></td> 
        <td><label for="TSI_OK"></label> 
        <select name="TSI_OK" id="TSI_OK"> 
         <option value="N/A">N/A</option> 
         <option value="TSI Query">TSI Query</option> 
        </select></td> 
       </tr> 
       <tr> 
        <td><p>Special Ins OK&#13;</p></td> 
        <td><label for="Special_Ins_OK"></label> 
        <select name="Special_Ins_OK" id="Special_Ins_OK"> 
         <option value="N/A">N/A</option> 
         <option value="SI Query">SI Query</option> 
        </select></td> 
       </tr> 
       </table></td> 
       <td width="376"><table width="279" align="center" height="44"> 
       <tr> 
        <td width="87"><p>Shipment ID&#13;</p></td> 
        <td width="97"><label for="Ship_ID"></label> 
        <input type="text" name="Ship_ID" id="Ship_ID"></td> 
       </tr> 
       </table></td> 
      </tr> 
      </table> 
     </form> 
     <h1>&nbsp;</h1> 
    </body> 
</html> 

은 내가 아래 부분

<%-- 
    Document : P2 
    Created on : Mar 7, 2013, 1:19:55 PM 
    Author  : u0138039 
--%> 

내가 원하는대로 내가 표를 얻고을 주석있을 때,하지만 난 그것을 행 공간 변화를, 주석을 해제 할 때 즉이 증가하고있다. 행 공간을 줄이고 위에서 언급 한 부분을 주석 처리하는 방법을 알려주십시오.

감사

+0

왜이 섹션은 body 태그 바깥입니까? –

답변

0

확인이 코드 :

<%-- Part 1 (Replace % with ! for HTML comment) 
    Document : P2 
    Created on : Mar 7, 2013, 1:19:55 PM 
    Author  : u0138039 
--> 
<!DOCTYPE html> 
<%-- Part 2 (Replace % with ! for HTML comment) 
    Document : P2 
    Created on : Mar 7, 2013, 1:19:55 PM 
    Author  : u0138039 
--> 

<html> 
<head> 
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
     <title>JSP Page</title> 
</head> 
<body> 
    <form name="form1" method="post" action=""> 
     <table width="722" border=1> 
     <tr> 
      <td width="334"> 
      <table width="255" border=1> 
      <tr> 
       <td width="128"><p>PARTS Updated&#13;</p></td> 
       <td width="111"><label for="PARTS_Updated"></label> 
       <select name="PARTS_Updated" id="PARTS_Updated" > 
        <option value=""></option> 
        <option value="N/A">N/A</option> 
       </select></td> 
      </tr> 
      <tr> 
       <td><p>TSI OK&#13;</p></td> 
       <td><label for="TSI_OK"></label> 
       <select name="TSI_OK" id="TSI_OK"> 
        <option value="N/A">N/A</option> 
        <option value="TSI Query">TSI Query</option> 
       </select></td> 
      </tr> 
      <tr> 
       <td><p>Special Ins OK&#13;</p></td> 
       <td><label for="Special_Ins_OK"></label> 
       <select name="Special_Ins_OK" id="Special_Ins_OK"> 
        <option value="N/A">N/A</option> 
        <option value="SI Query">SI Query</option> 
       </select></td> 
      </tr> 
      </table></td> 
      <td width="376"><table width="279" align="center" height="44" border=1> 
      <tr> 
       <td width="87"><p>Shipment ID&#13;</p></td> 
       <td width="97"><label for="Ship_ID"></label> 
       <input type="text" name="Ship_ID" id="Ship_ID"></td> 
      </tr> 
      </table></td> 
     </tr> 
     </table> 
    </form> 
    <h1>&nbsp;</h1> 
</body> 
</html> 

사례 1 : "1 부"와 "2 부"를 주석합니다. 그 다음 : enter image description here

사례 2 : "Part1"의 주석 처리를 제거하고 "Part2"를 주석 처리하는 경우. 그런 다음 : enter image description here

사례 3 : "Part1"에 주석을 달고 "Part2"의 주석을 제거한 경우. 그런 다음 : enter image description here

"DOCTYPE html로" 선언이 페이지에 기록 된 HTML의 버전에 대한 웹 브라우저에 대한 명령입니다

Case2에서는이 첫 줄이 하지 않기 때문에. "DOCTYPE html" 그래서 웹 브라우저는 html로 버전을 알 수 없으므로 나머지 태그를 포맷 할 수 없습니다.

는 Case3에서 첫 번째 줄이 "DOCTYPE html로"입니다 그래서 수 나머지 태그를 포맷 할 수 있도록, HTML의 버전을 알 수 웹 브라우저. 그래서 우리는 포맷 된 테이블을 얻고 있습니다.

+0

고마워요 동생이 일한 –

+0

@ rakesh-marsonio - 당신은 환영합니다 :) –

+0

형제 님이이 게시물을보실 수 있습니까 http://stackoverflow.com/questions/15269516/unable-to-get-elements-passed- from-html -thanks –

관련 문제