導航:首頁 > 萬維百科 > jsp網頁設計表格製作

jsp網頁設計表格製作

發布時間:2020-09-08 11:23:54

1、用JSP生成一個表格

提交頁面:page01.jsp
    <%@ page contentType="text/html"  pageEncoding="gbk"%>
    <html>
        <head></head>
        <body>
            <form action="page02.jsp" method="post">
                請輸入表格的行數:<input type="text" name="rolNum"/><br/>
                請輸入表格的列數:<input type="text" name="colNum"/><br/>
                <input type="submit" value="提交"/>
                <input type="reset" value="重置"/>
            </form>
        </body>
    </html>
 生成表格的頁面:page01.jsp
    <%@ page contentType="text/html"  pageEncoding="gbk"%>
    <html>
        <head></head>
        <body>
            <%
                //介面參數
                String colStr=request.getParameter("colNum");
                String rolStr=request.getParameter("rolNum");
                int colNum=0;
                int rolNum=0;
                //類型轉化
                try{
                    rolNum=Integet.parseInt(rolStr);
                    colNum=Integet.parseInt(colStr);
                }catch(Exception e){
                }
            %>
            <!--循環輸出表格-->
            <table border="1">
                <%
                    for(int i=0;i<rolNum;i++){
                 %>
                         <tr>
                 <%  
                        for(int j=0;j<colNum;j++){
                 %>
                            <td><%=i*j%></td>
                 <%           
                        }
                  %>
                      </tr>
                  <%     
                    }
                %>
             </table>
        </body>
    </html>

2、怎麼用JSP製作一個具有excel功能的網頁

依靠百度Hi聯系
有時間可以處理你的問題

6 | ES:\\
5 | 交易提醒:預付定金是陷阱
7 |
1 | 北京易軟個人軟體
5 | 全職軟體開發團隊
6 | 十年信譽鑄成品質
1 | 速度專業積累效率
5 | 定製信息管理系統更有優惠

3、網頁填表的製作

這涉及到asp.net資料庫方面的知識,三言兩語也說不清楚,我現在也正在學這方面,還幫不到你,不過就算別人吧代碼發給你,你還是需要在你的伺服器上構建資料庫,所以你還是先去學習一下關於資料庫方面的知識吧!

4、java jsp網頁製作的表格怎麼樣才能編輯

table放入form里,method='post' action='你想要提交到數據處理的地方'
每個td里加一個文本域input type='text'
用一個type='submit'的按鈕提交數據

5、Dreamweaver製作JSP網頁,如何在表格中加一行滾動圖片?

<marquee style="position:relative;" onMouseOver="this.stop()" onMouseOut="this.start()" scrollamount="1" scrolldelay="85" direction="up" behavior="scroll" height="60"> 在這里加要動的滾東西就行了<marquee>

marquee這個就是滾動屬性!
direction這個是滾動方向1
onMouseOver="this.stop()" 這個是滑鼠放上去停止!另一個自然就是開始了!

6、如何在JSP網頁中生成動態圖表

JSP頁面中嵌入動態圖表的兩種方法 :在JSP頁面中插入Applet小程序 ;通過JavaBean動態生成圖像。

JSP是一種廣泛應用的網頁設計技術 ,它是一種HTML和Java腳本混合的編程技術 ,它結合了HTML的靜態特性和Java語言的動態能力 ,因此用它進行動態網頁設計非常方便。在進行圖像處理時 ,一般處理靜態圖片非常容易 ,但是 ,在實際應用中常常需要動態地在網頁中生成二維的圖形.

基於JFreeChart開發的一個時序圖的繪制。代碼如下:

實例中createDataset()方法用於創建數據集合對象。時序圖的數據集合與其他數據集合不同,它需要添加一個時間段內的所有數據,通常採用TimeSeries類進行添加。該實例中通過Math類的random()方法進行隨機生成。

import java.awt.*;
import java.awt.event.ActionEvent;
import
java.awt.event.ActionListener;
import java.io.BufferedInputStream;
import
java.io.DataInputStream;
import java.io.FileOutputStream;
import
java.io.IOException;
import java.net.URL;
import
java.net.URLConnection;
import java.text.DateFormat;
import
java.text.ParseException;
import java.text.SimpleDateFormat;
import
java.util.Calendar;
import java.util.Date;
import java.util.Random;

import javax.swing.JApplet;
import javax.swing.Timer;

import org.jfree.chart.*;
import
org.jfree.chart.annotations.CategoryTextAnnotation;
import
org.jfree.chart.axis.CategoryAnchor;
import
org.jfree.chart.axis.CategoryAxis;
import
org.jfree.chart.axis.CategoryLabelPositions;
import
org.jfree.chart.axis.DateAxis;
import
org.jfree.chart.axis.DateTickUnit;
import
org.jfree.chart.axis.DateTickUnitType;
import
org.jfree.chart.axis.ValueAxis;
import
org.jfree.chart.labels.;
import
org.jfree.chart.plot.CategoryPlot;
import
org.jfree.chart.plot.PlotOrientation;
import
org.jfree.chart.plot.XYPlot;
import
org.jfree.chart.renderer.category.BarRenderer;
import
org.jfree.chart.title.TextTitle;
import
org.jfree.data.category.CategoryDataset;
import
org.jfree.data.category.IntervalCategoryDataset;

import org.jfree.chart.axis.NumberAxis;
import
org.jfree.data.category.DefaultCategoryDataset;
import
org.jfree.data.gantt.Task;
import org.jfree.data.gantt.TaskSeries;
import
org.jfree.data.gantt.TaskSeriesCollection;
import
org.jfree.data.time.Day;
import org.jfree.data.time.Second;
import
org.jfree.data.time.TimeSeries;
import
org.jfree.data.time.TimeSeriesCollection;
import
org.jfree.data.xy.XYDataset;

public class shixutu extends JApplet { 

     
//PLOT_FONT是一靜態的字體常量對象,使用此對象可以避免反復用到的字體對象被多次創建
      
private static final Font PLOT_FONT = new Font("黑體", Font.ITALIC ,
18);
      JFreeChart chart;

 //創建數據動態更新的監聽
  class DataGenerator extends Timer
implements ActionListener {
       
private static final long serialVersionUID =
3977867288743720504L;
       String
equID;                               
//設備ID號
       int
totalTask;                              
//任務數
       String[][]
strTask;                         
//任務情況

       public void
actionPerformed(ActionEvent actionevent) {           
addTotalObservation();
       }       DataGenerator()
{
       
 
           
super(1000,
null);
           
addActionListener(this);
           
System.out.println("super");
       
}
   }
  
   
//將更新的數據添加到chart中
   private void addTotalObservation()
{
    
 System.out.println("addTotalObservation");
        
//設置新的數據集
          
chart.getXYPlot().setDataset(createDataset());
        
//通知Jfreechart
數據發生了改變,重新繪制柱狀圖
        if
(chart != null)
{
            
chart.fireChartChanged();
        
}
    }
      private static void
processChart(JFreeChart chart)

                
//設置標題字體 
                
chart.getTitle().setFont(new Font("隸書", Font.BOLD,
26)); 
                
//設置背景色 
                
chart.setBackgroundPaint(new
Color(252,175,134)); 
                
XYPlot plot = chart.getXYPlot();      
//獲取圖表的繪制屬性 
                
plot.setDomainGridlinesVisible(false);
//設置網格不顯示 
                
//獲取時間軸對象 
                
DateAxis dateAxis = (DateAxis)
plot.getDomainAxis(); 
                
dateAxis.setLabelFont(PLOT_FONT); 
//設置時間軸字體 
                
//設置時間軸標尺值字體 
                
dateAxis.setTickLabelFont(new
Font("宋體",Font.PLAIN,12)); 
                
dateAxis.setLowerMargin(0.0);     
//設置時間軸上顯示的最小值 
                
//獲取數據軸對象 
                
ValueAxis valueAxis =
plot.getRangeAxis(); 
                
valueAxis.setLabelFont(PLOT_FONT);                    
//設置數據字體 
                
DateFormat format = new SimpleDateFormat("mm分ss秒"); 
//創建日期格式對象 
                
//創建DateTickUnit對象 
                
DateTickUnit dtu = new
DateTickUnit(DateTickUnitType.SECOND,30,format); 
                
dateAxis.setTickUnit(dtu);        
//設置日期軸的日期標簽         }        //將結果輸出在文件中          

private static
void writeChartAsImage(JFreeChart chart)

             
FileOutputStream fos_jpg =
null; 
             
try

                 
fos_jpg = new
FileOutputStream("D: estshixutu.jpg"); 
                 
ChartUtilities.writeChartAsJPEG(fos_jpg, 1, chart, 400, 300,
null); 
             
} catch (Exception e)

                
e.printStackTrace(); 
             
} finally

                 
try

                     
fos_jpg.close(); 
                
} catch (Exception e)

                 

             

         

         
//創建數據集合對象
         
public static XYDataset createDataset()

                  
//實例化TimeSeries對象 
                   
TimeSeries timeseries = new
TimeSeries("Data"); 
                   
Second second = new Second();
//實例化Day
                    
                  
double d =
50D; 
                   
//添加一年365天的數據 
                   
for (int i = 0; i < 500; i++)
{  
                       
d = d + (Math.random() - 0.5) * 10;
//創建隨機數據 
                       
timeseries.second(day, d);
//向數據集合中添加數據 
                       
second = (Second)
second.next();  
                  
}                 
TimeSeriesCollection timeSeriesCollection =                        
new
TimeSeriesCollection(timeseries); 
                 
//返回數據集合對象 
                 
return timeSeriesCollection;         } //Applet程序初始化   

public void init()
{
      // 1.
得到數據  
    XYDatasetdataset =
createDataset(); 
           
// 2.
構造chart  
           
chart =
ChartFactory.createTimeSeriesChart( 
                  
"時序圖示範", //
圖表標題  
                  
"時間", //
目錄軸的顯示標簽--橫軸  
                  
"數值", //
數值軸的顯示標簽--縱軸  
                  
dataset, //
數據集  
                  
false,
                  
false, //
是否生成工具  
                  
false //
是否生成URL鏈接  
                  
); 
          
// 3.
處理chart中文顯示問題  
          
processChart(chart); 
     
         
// 4.
chart輸出圖片  
          
//writeChartAsImage(chart); 
         
// 5. chart
以swing形式輸出   
          
//6.使用applet輸出
          
ChartPanel chartPanel = new
ChartPanel(chart);
          
chartPanel.setPreferredSize(new
java.awt.Dimension(800,500));       
          
getContentPane().add(chartPanel);        (new
DataGenerator()).start();
       
}

       public void
paint(Graphics g)
{
           if
(chart != null)
{
              
chart.draw((Graphics2D) g,
getBounds());
           
}
       }
  
public void destroy() {
  }
}

7、jsp網頁製作表格如何插入背景圖片

<table style="background-image:url(20141210202838_GRUaH.jpg);" width="1034" height="223">

8、網頁設計中的表格!

<tr>
<td height="890" background="imega/2.gif" valign="top">
<table width="102%" height="25" border="0" cellpadding="5" cellspacing="1"> <!--這個表格已經至頂 -->
<tr>
<td width="11%"> </td>
<td width="17%" valign="top">|<a href="i.jsp">111</a></td>
<td width="30%" valign="top" >這一段表格至頂</td>
<td width="42%"> </td>
</tr>
</table>
</td>
</tr>

9、jsp頁面怎樣實現以下表格

CSS樣式:
<style type="text/css">
table { text-align:center; border-top:1px solid #000; border-left:1px solid #000;}
table tr td { border-bottom:1px solid #000; border-right:1px solid #000;}
</style>
BODY裡面的代碼
<table width="900" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2">Q</td>
<td>C1</td>
<td>C2</td>
<td>C3</td>
</tr>
<tr>
<td rowspan="2">A</td>
<td>A1</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>A2</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td rowspan="2">B</td>
<td>B1</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>B2</td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
希望對你有幫助。。。望採納。。。

10、怎樣製作可填寫的網頁表格

那個是表單,不是表格。如果和用戶進行交互要用動態網頁技術(asp,php,jsp等)

與jsp網頁設計表格製作相關的知識