ASP에서 데이터를 가로로 표시하는 방법은 실제로 tr td를 제어하여 여러 행과 여러 열을 얻는 것입니다. 먼저 정적 테이블을 사용한 다음 출력을 반복할 수 있습니다.
다음과 같이 코드를 복사합니다.<%
sql=select * from serr where order by id asc
set rs=server.createobject(adodb.recordset)
rs.open sql,conn,1,1
%><style type=text/css>
< !--
body,td,th {
글꼴 크기: 12px;
}
-->
</style>
<table width=100% align='center'>
<%
for i=1 to rs.recordCount '변수 i 1 데이터베이스의 총 레코드 수에 대한 루프
if (i mod 4 =1) then '각 tr은 필요에 따라 수정할 수 있는 4개의 레코드를 표시합니다.
response.write <tr>
end if
response.write <td width=200> &rs (제목)&<br>&rs(con)&<br>&rs(www)&<br>&rs(키워드)&</td>
if (i mod 4 = 0) then
response.write </tr>
end if
rs .movenext
다음
rs.close
%>
</table>