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

查看:24
本文介绍了如何在 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

菲尔·休斯"

小安迪"

CC Sabathia"

"CC Sabathia"

AJ 伯内特"

哈维尔巴斯克斯"

我希望结果表像

<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 控件,因为它具有有趣的属性 RepeatColumnsRepeatDirection.

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

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

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