2012-07-06 3 views
0

html 테이블을 반환하는 ajax 요청을 수행합니다. 그 페이지로 리다이렉트 할 때 표가 제대로 표시되지만 div 요소 안에 Ajax 응답을 넣으면 표가 엉성해진다.ajax 요청에 의해 반환 된 테이블이 제대로 표시되지 않습니다.

function submitQuery() { 
    length = category_query.length; 
    if(category_query.indexOf('ALL') != -1) 
    category_query = category_query.substring(0,length-4);  
    xmlhttp.onreadystatechange=function() { 
    if(xmlhttp.readyState==4 && xmlhttp.status==200) 
     document.getElementById('resultDiv1').innerHTML = xmlhttp.responseText; 
    } 
    xmlhttp.open("GET","cons_query.php?q="+category_query,true); 
    xmlhttp.send(); 
    //window.location="cons_query.php?q="+category_query; 
    //if i just redirect to this location, the table is displayed fine. 
} 

표가 아약스를 통과하는 것처럼 보이기를 원합니다.

+1

더 쉬운 AJAX 요청을 위해 jQuery를 사용하십시오. – Hidde

+0

표가 스타일을 가져야합니다. –

+0

@COLDTOLD 스타일을 얻는 방법? – user1505986

답변

0

음 ... 사용자가 응답 페이지의 왼쪽 행 요소를 떠 다니는 것처럼 보입니다. CSS에서 해당 서식을 제거하십시오. 다음과 같이 표시됩니다. td {width : <> px; 왼쪽으로 뜨다; }

관련 문제