3

这是我的 Struts 代码。我想知道如何调整[last/prev] [next/last]显示标签中链接的位置

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://displaytag.sf.net" prefix="display" %>
<html>
`enter code here`
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Forbes Top 10 Richest Sports Stars 2009</title>
<link href="css/displaytag.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <h2>Forbes Top 10 Richest Sports Stars 2009</h2>
    <display:table export="true" id="data"
        name="sessionScope.HomeForm.richSportsmanList"
        requestURI="/homeAction.do" pagesize="3">
        <display:column property="place" title="Place" sortable="true" />
        <display:column property="name" title="Name" sortable="true" />
        <display:column property="age" title="Age" sortable="true" />
        <display:column property="annualIncome" title="Income(in m/yr)"
            sortable="true" />
    </display:table>
    <p>Note : List is according to Forbes List 2009</p>
</body>
</html>
4

2 回答 2

1

displaytag 允许通过display.properties文件修改其特性。您可以覆盖默认为paging.banner.placement要调整横幅位置的属性(其中 [first/prev] [next/last] 链接),您必须覆盖该属性top<display:setProperty name="paging.banner.placement" value="bottom" />

paging.banner.full=<div class="pagelinks" align="right"><a href={1}>First</a><a href={2}>Prev</a>{0}<a href={3}>Next</a><a href={4}>Last</a></div>

现在您必须通过更改类pagelinks或通过添加style属性来设置横幅的位置来修改 div 标签的样式。例如position: absolute; top: 75px; left: 260px; width: 245px; background-color: azure;

于 2013-01-22T19:39:09.247 回答
0

Roman 建议了您可以在属性文件中使用的方式。但有时属性文件解决方案不起作用 :: Here is the solution

<display:setProperty name="paging.banner.full" value='<span class="pagelinks"><a href="{1}" onclick="return false"></a> <a href="{2}"><span class="pagenation_LeftAro"/></a>  <a href="{3}"><span class="pagenation_RightAro"/></a><a href="{4}" onclick="return false"></a></span>' />

<display:setProperty name="paging.banner.first" value='<span class="pagelinks"><a href="{1}"  onclick="return false"></a> <a href="{2}" onclick="return false"></a> <a href="{3}"><span class="pagenation_RightAro"/></a><a href="{4}" onclick="return false"></a></span>' />

<display:setProperty name="paging.banner.last" value='<span class="pagelinks"><a href="{1}" onclick="return false"></a> <a href="{2}"><span class="pagenation_LeftAro"/></a> <a href="{3}" onclick="return false"></a><a href="{4}"  onclick="return false"></a></span>' />     

                                      <display:setProperty name="paging.banner.some_items_found" value='<span class="pagelinks"> {2}-{3} of {0}.</span>'/>
                                <display:setProperty name="paging.banner.all_items_found" value='<span class="pagelinks">1-{0} of {0}.</span>' />

通过这种方式,您可以使用定制的分页横幅..

于 2014-06-19T08:57:27.327 回答