如何在ASP.Net Repeater中创建三列表 [英] How to create a three column table in ASP.Net Repeater

查看:111
本文介绍了如何在ASP.Net Repeater中创建三列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够使用ASP.Net Repeater控件创建一个HTML表,其中包含三列和行数与necc一样多。

I would like to be able to use the ASP.Net Repeater control to create an HTML Table that has three columns and as many rows as necc.

例如如果数据看起来像这样

For example if the Data were to look like this

Phil Hughes

"Phil Hughes"

Andy Petite

"Andy Petite"

CC Sabathia

"CC Sabathia"

AJ Burnett

Javier Vazquez

"Javier Vazquez"

我希望得到的表格像

<table>
 <tr>
  <td>Phil Hughes</td>
  <td>Andy Petite</td>
  <td>CC Sabathia</td>
 </tr>
 <tr>
  <td>AJ Burnett</td>
  <td>Javier Vazquez</td>
  <td></td>
 </tr>
</table>

我该怎么做?

推荐答案

最好使用DataList控件,因为它具有有趣的属性 RepeatColumns RepeatDirection

It's better to use a DataList control intstead as it has the interesting properties RepeatColumns and RepeatDirection.

这篇关于如何在ASP.Net Repeater中创建三列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆