Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
448 views
in Technique[技术] by (71.8m points)

java - How to adjust the position of [last/prev] [next/last] links of Display Tag in Struts 2

Here is my Struts code. I would like to know that how can I adjust the position of [last/prev] [next/last] links in display tag

<!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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The displaytag allows modification of its features through the display.properties file. You can override the property paging.banner.placement that is top by default to the <display:setProperty name="paging.banner.placement" value="bottom" /> To adjust position of the banner (where [first/prev] [next/last] links in) you have to override the property

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>

Now you have to modify the style of the div tag via changing the class pagelinks or via adding style attribute to set the position of the banner. For example position: absolute; top: 75px; left: 260px; width: 245px; background-color: azure;


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...