This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

how to get tabular output.?

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone,i am new to the javascript .i have started writing one function and i need your help in that.

I have to write the function .

function logtable(actionname,starttime)
{
Now
1) i am getting two parameters actionname,startime.now i have to make a table where parameters represents the 3 columns.i have to append the data in the table .
2)the o/p will be like this(tabular format):

actionname starttime delta

start 11.22.32.10 0
open 11.22.32.60 50
save 11.22.32.80 20


delta is the difference between the two consecutive starttime.
i have to append each incomming record in the next row(as i have shown in the o/p) .how should i do this(how to create table and append record to that and how to subtarct two strings(starttime) to get delta??

thank you.
 
swapnil paranjape
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everybody....i cud manage to write values in the table but i donot know how to calculate difference between two consecutive starttime values
delta = startime2 -starttime1 i.e. difference between two consecutive starttimes....hence delta in first row will be zero and then it will have value.

function PrtRow(action, starttime) {

var delta = starttime;
newcol = "/TD TD ALIGN='RIGHT'>";
document.write("TR TD ", action, newcol, starttime, newcol,
delta, "</TD></TR>\n")

var temp1 = starttime;
}
PrtRow("start", 11);
PrtRow("open", 12);
PrtRow("save", 13);
PrtRow("upload", 14);
PrtRow("new", 15);
PrtRow("upload", 16);
 
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!