Share on Google+Share on Google+

auto resize
2 Answer(s)      6 years and 4 months ago
Posted in : JavaScript Questions

Dear Sir, I have a table with 60 coloumns and 90 rows.If i give the print option it s not comin in one page.Can you please tell me the javascript code for auto resizing it into one window or fit to the window while taking the print.

Regards Debasis


View Answers

December 7, 2010 at 4:43 PM

Hi Friend,

You can do paging using jsp.

Here is the code:


<%@ page language="java" %>
<%@ page import="java.sql.*" %>
public int nullIntconvert(String str){
int num=0;
if(str==null) {
else if((str.trim()).equals("null")) {
else if(str.equals("")) {
catch(Exception e) { }
return num;
Connection conn = null;
conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root";, "root");
ResultSet rs1 = null;
ResultSet rs2 = null;
PreparedStatement ps1=null;
PreparedStatement ps2=null;

int showRows=10;
int totalRecords=10;
int totalRows=nullIntconvert(request.getParameter("totalRows"));
int totalPages=nullIntconvert(request.getParameter("totalPages"));
int iPageNo=nullIntconvert(request.getParameter("iPageNo"));
int cPageNo=nullIntconvert(request.getParameter("cPageNo"));

int startResult=0;
int endResult=0;
if(iPageNo==0) {
String query1="SELECT SQL_CALC_FOUND_ROWS * FROM student limit "+iPageNo+","+showRows+"";

String query2="SELECT FOUND_ROWS() as cnt";
if( {
<h3>Pagination of JSP page</h3>
<input type="hidden" name="iPageNo" value="<%=iPageNo%>">
<input type="hidden" name="cPageNo" value="<%=cPageNo%>">
<input type="hidden" name="showRows" value="<%=showRows%>">
<table width="100%" cellpadding="0" cellspacing="0" border="1" >
<td>Roll No</td>
while( {
if(totalRows<(iPageNo+showRows)) {
catch(Exception e){
<td colspan="3">

December 7, 2010 at 4:44 PM


int i=0;
int cPage=0;
if(totalRows!=0) {

int prePageNo=(cPage*totalRecords)-((totalRecords-1)+totalRecords);
<a href="pagination.jsp?iPageNo=<%=prePageNo%>&cPageNo=<%=prePageNo%>"> << Previous</a>
<a href="pagination.jsp?iPageNo=<%=i%>" style="cursor:pointer;color: red"><b><%=i%></b></a>
else if(i<=totalPages){
<a href="pagination.jsp?iPageNo=<%=i%>"><%=i%></a>
if(totalPages>totalRecords && i<totalPages){
<a href="pagination.jsp?iPageNo=<%=i%>&cPageNo=<%=i%>"> >> Next</a>
<b>Rows <%=startResult%> - <%=endResult%> Total Rows <%=totalRows%> </b>


catch(Exception e)

In the above code,we have created the database table student(rollNo,name,marks,grade).


Related Tutorials/Questions & Answers:
auto resize
auto resize  Dear Sir, I have a table with 60 coloumns and 90 rows.If i give the print option it s not comin in one page.Can you please tell me the javascript code for auto resizing it into one window or fit to the window while
auto  write a java code design an auto with as many feature as possible
Objective C resize UIImage
Objective C resize UIImage  i just want to resize the image on the touch detection. That means if a user double clicks on the UIImage it must resize the image
Resize image stored in database
Resize image stored in database  hi, Can any one please send code for how to resize image stored in database in blob datatype in jsp, i want to resize it to 140(w)*160(h) please help me
resize the tiff file - WebSevices
resize the tiff file  please guide me how i resize the tiff file and i want to upload it?   You can resize the tiff image as well as other type image. I am sending code, i hope it will help to you... Thanks
resize a panel slowly - IDE Questions
resize a panel slowly  How to code to resize a panel slowly with netbeans
Image Resize in Flex
Image Resize in Flex  Hi....... I am going to add images into a tag. How will it resize itself? Please tell me about that.... Thanks  Ans: The image resize is the part of laying out of your application. you
Resize browser in flex
Resize browser in flex  Hi........ Please tell me about How can I Resize the Internet Explorer browser window from flex ? please give me the appropriate answer Thanks  Ans: UsegetURL() to communicate
Resize Header in CSS
Resize Header in CSS  Hi all, Please let me know if we can resize the Header tags in HTML for example H1,H2 and so on... Actually, it looks very...;We can resize header tags in CSS .. and further call that class into you HTML
Spark Resize effect in Flex4
Spark Resize effect in Flex4: The Resize effect changes the height, width... and shrink the size of component using Resize effect.  The tag of Resize effect is <s:Resize>. In this example you can see how we can use a Resize
MX Resize Effect in Flex4
MX Resize Effect in Flex4: The Resize effect changes the height, width or both... the size of component using Resize effect. The tag of Resize effect is <mx:Resize>. In this example you can see how we can use a Resize effect
resize the tiff file in php - WebSevices
resize the tiff file in php  please guide me how i resize the tiff file and i want to upload it? using php  Hi I am sending the code of file upload in php. please check it, i hope it will help you... FileUpload.php
resize dynamic image in jsp - JSP-Servlet
resize dynamic image in jsp  Sir, I am saving the images in mysql database with Blob. An I am retrieving the images with this code:- I am getting my image with this code but all I need that I want to resize
What is Auto Wiring?
What is Auto Wiring?  Hi, What is Auto Wiring? Thanks
auto update codings
auto update codings  auto update coding in xml
how to generate auto code ?
how to generate auto code ?  i wanna genrate auto code for id in core java. pls tell me code of auto genrate
i want to resize the tiff file also - WebSevices
i want to resize the tiff file also  if($objFiles['photo']['name...']); $FileName= time().$objFiles['photo']['name']; $this->resize_image...'],180,135); } function resize_image($src,$dest,$type,$new_width,$new
auto sql script - SQL
auto sql script  Is there a way of generating inserts scripts using the table structure for oracle database
resize image with the change in size of jpanel.. - Java Beginners
resize image with the change in size of jpanel..  hi.. i am try to insert image in jpanel in jform to give attractive look to application,but the of image do not changes if the size of jframe or jpanel changes. if there is any
Date auto format
Date auto format  Hi, I have jsp page and Date field with input type. Requirement is, if we enter date as MMDDYY or MMDDYYYY and clicking the tab the date(MMDDYY or MMDDYYYY) have to auto format to MM/DD/YYYY. could you please
Auto Generated Employee ID
Auto Generated Employee ID  Hello Everyone I want to generate an ID like (SCS-0001) and then it should be auto incremented each time a new employee add page is opens. I am using My Sql database
Stumped with NOT NULL AUTO_INCREMENT  I've almost made it through my... to create a new table with the ID column being NOT NULL AUTO_INCREMENT. The table will create if I do not have NOT NULL AUTO_INCREMENT, but it WILL NOT create
Auto field update
Auto field update  In my application I have a field called status which is having the 4 values like new,submitted,approved, rejected. How to set those filed in Database(MySQL), and how to auto update that field status in other
i want to resize tiff formated file in php - WebSevices
i want to resize tiff formated file in php  i know how to resize the jpeg,gif,png files but i need the code only for "tiff" files ? plz send guide lines for how to resize the tiff files?  Hi raja I could help better
Yahoo Auto Suggest
Yahoo Auto Suggest  Am using Yahoo Library for Auto Suggest and it is implementing well.. My Requirement is I've two radio buttons with a and b and its name is stype. When i selected a, I'll get a different suggestions
Resize outer div when inner div's height increases
Resize outer div when inner div's height increases   How can I increase the outer div height automatically when inner div's height increases in javascript
auto complete text box - Ajax
auto complete text box  How to create auto complete text box in jsp using ajax technology ? plz giv me steps wise code
Auto Fill Textbox - Java Beginners
Auto Fill Textbox   hi i am going to develope a php page with a select box and i want that this select box get auto fill when i write on it. please help me
MySQL Auto_Increment
MySQL Auto_Increment This example illustrates how to define AUTO_INCREMENT of a field. The AUTO_INCREMENT attribute can be used to generate a unique... AUTO_INCREMENT, name CHAR(30) NOT NULL, PRIMARY KEY (id
Auto Search box using ajax
Auto Search box using ajax   Hi , i want to implement auto search box functionality like google and linkedin using ajax,jsp,servlet, javascript etc.when the value appears on the textbox then we should also be able to select
Jtree Nodes auto Hiding Problem
Jtree Nodes auto Hiding Problem  Have a nice day to everyone I am using Jtree and developed one hierarchic model as per requirement but i am having large no. of node so i have to hide of fold those node which i am not looking
Java Spring Hibernate Struts Training code for programming How can I dynamically load user-entered data as content of jquery dialog? java webcam integration question java coding Fix Scrollbar position in a checkboxList after postback Information Save Alert Country wise redirection to files Interface in javascript connect database with javascript Zip Code ZipCode how to validate the email login How to play FLV video files on Ipad using HTML code or javascript code? Nitobi Grid is not working in IE10/IE11 jquery issue plese help RegEx Tree structure from json whose parents can be dragged and dropped from child newyorklife insurance getElementById not working javascript code for search in html file Implement The Skeleton Code Implement This Skeleton Code Mobile Automation using Appium Computer forensic application Java: Searching a string from doc files java linked list urgent !!! java linked list urgent!!! library management library management library management library management question Html form using JavaScript to display the table content java how to prevent no from unroundin off on clicking text box again in JSP and Jquery graph generation from xml design file display data from database in textbox when id entered in textbox Javascript Code for all fields how to get HTTP GET request value using javascript array Javascript Querry autocomplete(): Spring mvc with jquery: I am not getting correct value in the text filed. Please help me Create SpreadSheet same as excel using java applet Create SpreadSheet same as excel using java applet How to change focus among multiple select boxes? Write JQUERY Code Write JQUERY Code Converting jsp variable to java variable java


Advertisement null