Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-15-2012, 10:26 AM   PM User | #1
Papichoolo
New to the CF scene

 
Join Date: Jan 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Papichoolo is an unknown quantity at this point
JavaScript for Generating a Multiplication table

Ok, just to be honest this is for my assignment from my University, I have completed the whole code myself I just can't seem to get just one little thing.



Code:
function GenerateTables(){
	var start = document.tables.start.value;
	var end = document.tables.end.value;
	var size = document.tables.size.value;
					
	for (start; start <= end; start++) {
	document.write("<table width='100' align='center'>")
	document.write("<caption><b>Table of </b>" + start + "</caption><br>")
	document.write("</table><br>")
						
	for (var i = 1; i <= size; i++) {
							
	document.write("<table border=1 align='center'>")
	document.write("<tr height=40 align='center'>")
	document.write("<td width=40 align='center'>" + start + "</td>")
	document.write("<td width=40 align='center'> * </td>")
	document.write("<td width=40 align='center'>" + i + "</td>")
	document.write("<td width=40 align='center'>  =  </td>")
	document.write("<td width=40 align='center'>" + start * i + "</td>")
	document.write("</tr>")
	document.write("</table>")
  }
 }
}
The function generates multiplication tables depending on the input user provides using this interface (given below).



And it generates them like this (given below).



Now what I want is to generate those tables sideways not downwards. Not all the tables, but it should complete one table downwards, then start the new table on its side.



I can't seem to figure out anything that would make that happen, and ideas would be appreciated, thanks.

Regards,
Papichoolo.

Last edited by Papichoolo; 01-15-2012 at 10:42 AM..
Papichoolo is offline   Reply With Quote
Old 01-15-2012, 11:08 AM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,044
Thanks: 197
Thanked 2,412 Times in 2,390 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Suggest you get together with parishay at http://www.codingforums.com/showthread.php?t=248891

But your question really relates to HTML not Javascript.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Philip M is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:07 AM.


Advertisement
Log in to turn off these ads.