while not rs.eof intCol = intCol + 1 ----- Put your outdata here if intCol = 4 then response.write "</tr><tr>" intCol = 0 end if rs.movenext wend