something like

<table>

<%

String message[];
message=(String[])request.getAttribute("jsp");

int noOfColumns = message.length/4;

for(int j=0;j<message.length;j++)
{
    if(noOfColumns == 0)
    {

        %>
        <td>
        <input type="button" name=<%=message[j]%>  value="<%=messsage[j]%>"
            style="width:200px">
        </td>
        <%
    }
    else
    {
        for(int colCount=0; colCount<noOfColumns && j<message.length;
colCount++, j++ )
        {

        %>
        <td>
          <input type="button" name=<%=message[j]%>
value="<%=messsage[j]%>"
            style="width:200px">
        </td>
        <%
        }
        j--;
    }
    %><tr></tr>
<%
}

</table>

_______________________________________________________________
Moreover i would suggest searching on google for a tag which does this job.


----- Original Message -----
From: "Edward" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 11, 2002 11:44 AM
Subject: How to put my buttons in the middle of screen?


> I have a JSP,it get String[] from Servlet.If String[] length between 1 and
4,then put them in the middle of screen by one column.If String[] length
between 4 and 8,then put them in the middle of screen by two columns.My JSP
is follows:
>
>
> <html>
> <title>User Menu</title>
> <body>
>   <%
>    String message[];
>
>    message=(String[])request.getAttribute("jsp");
>    for(int j=0;j<message.length;j++)
>    {
>       show=...;
>   %>
>      <br>
>      <input type="button" name=<%=show%>  value="<%=show%>" style="width:
200px">
>      <br>
>   <%
>    }
>   %>
> </body>
> </html>
>
> I don't know how to realize this function.Please help!
> Thanks in advance!!!
> Edward
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to