PDA

View Full Version : spacing between struts tags


nAzGiRl2005
09-09-2005, 08:02 PM
I have the following jsp code that contains three buttons and a link to a page.

The three buttons are located at the end of a jsp form (left-hand-side). I want the link to be located on the right-hand-side bottom of the form, that is I want spacing between the last button and the link. (without spacing between buttons themselves).
here's the code:


<tr height="50">
<td colspan="5">
<nobr>
<table>
<tr>
<td align="left">
<html:submit property="submitButton" styleClass="button" value="Get Report" onclick="return(doReportSubmit(document.searchReportForm, 'report', 1));"/>

<html:submit property="submitButton" styleClass="button" value="Create Spreadsheet" onclick="return(doReportSubmit(document.searchReportForm,'spread', 1));"/>

<logic:equal scope="session" name="user" property="role" value="administrator">

<html:submit property="submitButton" value="Edit View" styleClass="button"/>
</logic:equal>

<logic:equal scope="session" name="user" property="role" value="administrator">
<a href="javascript:popUp('pages/searchEngineInfo.htm');"> View Page Info </a>
</logic:equal>
</nobr>
</td>
</tr>
</table>
</td>
</tr>

Does anybody know how to do this?

nikkiH
09-09-2005, 09:38 PM
This link?

<a href="javascript:popUp('pages/searchEngineInfo.htm');"> View Page Info </a>

Do this instead.
<div style="display:inline; margin-left: 10%;"><a href="javascript:popUp('pages/searchEngineInfo.htm');"> View Page Info </a></div>

Set margin-left as desired.

nAzGiRl2005
09-10-2005, 03:08 AM
this is very helpful. but I actually just found out that I can't measure the distance between the buttons and the link.
Is there any way to make this link align towards the right of the form? that is,
no matter how many buttons I have, and how big they are, I want to have the link remain at the same place.

Here's my code again:


<tr>
<td colspan="5">
<hr size="1" noshade />
</td>
</tr>

<tr height="50">
<td colspan="5">
<nobr>
<html:submit property="submitButton" styleClass="button" value="Get Report" onclick="return(doReportSubmit(document.searchReportForm, 'report', 1));"/>
<html:submit property="submitButton" styleClass="button" value="Create Spreadsheet" onclick="return(doReportSubmit(document.searchReportForm,'spread', 1));"/>

<logic:equal scope="session" name="user" property="role" value="administrator">
<html:submit property="submitButton" value="Edit View" styleClass="button"
onclick="return(doReportSubmit(document.searchReportForm,'view', 1));"/>
</logic:equal>

<a href="javascript:popUp('pages/searchEngineInfo.htm');"> View Page Info </a>

</nobr>
</td>
</tr>
</table>
I appreciate your help.

nikkiH
09-12-2005, 03:13 PM
Actually, it has nothing to do with the server code (except for setting ids or style classes so CSS can affect it).

This is something you'd have to play with the CSS with. I'm not the world's greatest with CSS, so you might want to make a post over in the html/css forum. I make server-side code. Other people make it purty. LOL

Copy out the html the browser "sees" (view source), make a test page out of it, and muck with the CSS until it does what you want. Use a stylesheet so you don't have to keep modifying your JSP source. Also makes it easier for the style gurus to know how to make it display nice.

This is what CSS is for -- the separation of data and display.