<display:table name="allNewsList" cellspacing="0" cellpadding="0" pagesize="20">
  
  <!--这里如何产生一列checkbox-->
  <!--这里如何产生行号:1,2,3...?-->
  
  <display:column property="title" title="标题" url="/detail.jsp" paramId="id" paramProperty="id"/> 
  <display:column property="pubdate" title="发布日期" format="{0,date,yyyy-MM-dd HH:mm:ss}"/>
  <display:column property="catalog_id" title="类别"/>
</display:table>

解决方案 »

  1.   

    我用过.但是没用过象这样的产生行号.
    我想你可以把行号放在一个属性中.
    比如你的
    News
    {
    title ; 
    pubdate ;
    catalog_id ;
    name ;    //这个属性是我虚拟出来的,我想的News类中也该有没在页面上显示的某个字段吧
    }
    然后对allNewsList中的每个News的name设成 行号.
    另外
    下面是我在官网上找的例子,你试下:
    uid ----  Unique id used to identify this table. The object representing the current row is also added to the pageContext under this name, so that you can refer to it in column bodies using ${uid}. You can also use uid_rowNum to refer to the current row number. Two tables in the same page can't have the same id (paging and sorting will affect both). If no "htmlId" is specified the same value will be used for the html id of the generated table.  <display:table name="someList" export="true" id="row" requestURI="MyAction.do">
      <display:column sortable="true" title="ID"> <c:out value="${row.id}"/> </display:column>
      <display:column property="email" autolink="true"/>
      <display:column property="description" title="Comments"/>
    </display:table>
    摘自:
    http://displaytag.sourceforge.net/11/displaytag/tagreference.html我现在的项目有点乱,等有时间帮你试一下.
      

  2.   

    <display:table name="allNewsList" cellspacing="0" cellpadding="0" pagesize="20" id="row">
      <display:column title="序号"><c:out value="${row_rowNum}"/></display:column>
    楼上的谢谢,这样就行了!