Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Thanked 0 Times in 0 Posts

    javascript table generator

    Hi there if someone could help i would really apreciate it.I am looking for a table generator that works with prompts. Something like this the first prompt asks How many rows? second prompt How many columns? third prompt Border size fourth prompt Bgcolor and fifth prompt Create table... If someone could help me out with source code i will be very grateful....

  • #2
    Regular Coder
    Join Date
    Oct 2006
    Thanked 5 Times in 5 Posts
    Well, I sure dislike all those bells when I work with prompts and alerts.
    What do you think of this?

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HEAD><TITLE>MakeAtable </TITLE>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <STYLE type=text/CSS>
    <SCRIPT type="text/javascript">
    function mktbl(r,c){

    var stbl='<TABLE BORDER="1">\n <TBODY>\n';
    for(j=0;j<r;j++){stbl+=' <TR>\n'; for(i=0;i<c;i++){stbl+=' <TD> @ </TD>\n';}; stbl+=' </TR>\n'}
    stbl+=' </TBODY>\n</TABLE>\n';
    <META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
    <TABLE cellpadding=0 cellspacing=0 border=1>
    <TD><input type="button" class="bttn" onclick="mktbl(1,1)"></TD>
    <TD><input type="button" class="bttn" onclick="mktbl(1,2)"></TD>
    <TD><input type="button" class="bttn" onclick="mktbl(1,3)"></TD>
    <TD><input type="button" class="bttn" onclick="mktbl(2,1)"></TD>
    <TD><input type="button" class="bttn" onclick="mktbl(2,2)"></TD>
    <TD><input type="button" class="bttn" onclick="mktbl(2,3)"></TD>
    <TD><input type="button" class="bttn" onclick="mktbl(3,1)"></TD>
    <TD><input type="button" class="bttn" onclick="mktbl(3,2)"></TD>
    <TD><input type="button" class="bttn" onclick="mktbl(3,3)"></TD>
    <TABLE BORDER="0">
    <TD><textarea id="abc" style="height:300;width:300"></textarea>
    <TD id="def"></TD>


    Something gets lost when I paste that inot notepad,
    here, have it direct and change the extension to .html
    Attached Files Attached Files
    Last edited by rubenbuhr; 11-10-2006 at 12:49 AM.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts