日期:2014-05-18  浏览次数:20495 次

datareader实现显示图片:一行2个,显示4行共8张图,以下代码...................
while   (mydr.Read())
{
picturehtml+= " <tr   align= 'center '   valign= 'middle '> <td   width= '75 '   height= '64 '> <table   width= '54 '   height= '54 '   border= '1 '   style= 'border-collapse:collapse '   bordercolor= '09A5B7 '> <tr> <td> <img   src= ' "+mydr[ "picture "]+ " '   width= '50 '   height= '50 '> </td> </tr> </table> </td> ";
picturehtml+= " <td   width= '10 '   align= 'center '   valign= 'middle '> <img   src= 'pic/point.gif '> </td> ";
picturehtml+=   " <td   width= '75 '> &nbsp; </td> ";
picturehtml+= " </tr> ";
picturehtml+= " <tr   align= 'center '   valign= 'middle '> <td   height= '10 '   colspan= '3 '> </td> </tr> ";
}
mydr.Close();
conn.Close();
picturehtml   +=   " </table> ";


以上是实现了竖排显示8张图片,我想实现一行2个,显示4行共8张图的效果,请问
该如何做呀?好象datareader自动移动光标到下一个记录,并且datareader也不支持
dr.movenext方法呀?我该怎么办?怎么办?

20分奉送表心意~

------解决方案--------------------
用datalist吧,很好用的
------解决方案--------------------
1.嵌套循环
for(int i=0 ; i <4; i++)
{
for(int j=0; j <2; j++)
{
mydr.Read();
Response.Write();
.............
}
}
2.用css实现