Results 1 to 7 of 7

Thread: How to Load js Content into a css Styled Table?

  1. #1
    Join Date
    Jul 2006
    Posts
    289

    How to Load js Content into a css Styled Table?

    I have done JavaScript to better extent. I have written the code but not getting the result properly. I am not able to load js content. Please explain me how to load js content into a css Styled Table.?? I have having an array in the js content. All I want is to load that array into a separate table row. The js file currently has 12 links but they are all currently loading into 1 table row. so in short, 1 have 11 table rows that are empty. Any help would be greatly appreciated. !!!
    Signatures reduce available bandwidth

  2. #2
    Join Date
    Nov 2008
    Posts
    996

    Re: How to Load js Content into a css Styled Table?

    Before doing the coding you should know some basic steps which are very useful to the beginners of the advanced programming. So, i thought that giving you the information about that would be useful.
    • The object detection should be inserted into the script. Because if you write a complex script, you start by finding out if your users' browsers support advanced scripting. At such time object detection is useful.
    • Statements are JavaScript commands. And the two most important ones are : if() and for().
    • Every script you'll write consists of functions. A function is a short series of commands that does something for you.
    • Boolean logic is used by all programming languages. It defines the user of AND (&&), OR (||) and NOT (!).

  3. #3
    Join Date
    Nov 2008
    Posts
    1,192

    Re: How to Load js Content into a css Styled Table?

    I think that you have done the coding for loading js content into a css styled table..!! Have you used the AJAX..?? I think it would be better if you provide some sample of the coding, so that I (also others) will able to detect the exact issue.!! What is the JS content to display? Also I want to know what are the CSS style parameters.?? So, it would be better if you provide the coding of it..!!

  4. #4
    Join Date
    Jul 2006
    Posts
    289

    Re: How to Load js Content into a css Styled Table?

    Extremely Thanks for giving time to me..!! The following is the js code :
    Code:
    function linkDisplay() {
    var links = new Array();
    links[0]="My Autobiography - Book ";
    links[1]="The Jack and Beans - Fairy Tales";
    
    var linkURL = new Array();
    linkURL[0]="http://www.greatperson.com/web1/autobiography";
    linkURL[1]="=http://www.disneytales.com/click-245324-10785 target=_top";
    
    for (i=0; i<links.length; i++) {
    document.write("<ol>"+links[i].link(linkURL[i])+"</ol>");
    }
    }
    Signatures reduce available bandwidth

  5. #5
    Join Date
    Mar 2008
    Posts
    672

    Re: How to Load js Content into a css Styled Table?

    I have looked at the code but I didn't find any errors or something missing.!! I have not yet checked that personally but looking at the code I can say that it should be alright. So, I think that something is wrong with the HTML coding. It would be easy to explain if you provide the coding used in the HTML. !! I am sure that something must be wrong over there.!!

  6. #6
    Join Date
    Jul 2006
    Posts
    289

    Re: How to Load js Content into a css Styled Table?

    Sorry, for not providing the HTML code at the starting.!! I thought that something was wrong in the js file. Here is the coding of HTML file :
    HTML Code:
    <html xmlns="http://www.javascript.org/2001/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script type="text/javascript" src="link.js"></script>
    <style type="text/css">
    <!--
    #table {
    position:absolute;
    width:510px;
    height:43px;
    z-index:1;
    border-collapse: collapse;
    border: 2px solid;
    border-color:#00CCCC;
    font-family: "Comic Sans MS", "Lucida Grande", Sans-Serif;
    font-size: 16px;
    }
    
    #table tbody tr:hover td {
    background: #d0dafd;
    }
    
    #table td {
    color: #00CCFF;
    }
    #table th
    {
    color: #2299FF;
    border-bottom: 2px dashed #69c;
    }
    -->
    </style>
    </head>
    
    <body>
    <table width="520" border="1" cellpadding="0" cellspacing="0" id="table">
    <tr>
    <td id="0"><script type="text/javascript">linkDisplay();</script></td>
    </tr>
    <tr>
    <td id="1"></td>
    </tr>
    <tr>
    <td></td>
    </tr>
    <tr>
    <td></td>
    </tr>
    </table>
    </body>
    </html>
    Expecting for the help..!!
    Signatures reduce available bandwidth

  7. #7
    Join Date
    Nov 2008
    Posts
    1,192

    Re: How to Load js Content into a css Styled Table?

    I think that your problem will get solved after writing the following code :
    HTML Code:
    <html xmlns="http://www.javascript.org/2001/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script type="text/javascript"> <!-- src="link.js" -->
    
    var links = [
        ["My Autobiography - Book","http://www.greatperson.com/web1/autobiography"],
        ["The Jack and Beans - Fairy Tales",
         "http://www.disneytales.com/click-245324-10785 target=_top"]	
    ];
      
    function linkDisplay() {
      var str = '';
      for (i=0; i<links.length; i++) {
    	str += '<tr><td id="'+i+'">';
        str += "<ol><a href="+links[i][1]+">"+links[i][1]+"</a></ol>";
        str += "</td></tr>";
      }
      document.write(str);
    }
    
    </script>
    <style type="text/css">
    
    #table1 {
      position:absolute;
      width:510px;
      height:43px;
      z-index:1;
      border-collapse: collapse;
      border: 2px solid;
      border-color:#00CCCC;
      font-family: "Comic Sans MS", "Lucida Grande", Sans-Serif;
      font-size: 16px;
    }
    
    #table1 tbody tr:hover td {
      background: #d0dafd;
    }
    
    #table1 td {
      color: #00CCFF;
    }
    #table1 th {
      color: #2299FF;
      border-bottom: 2px dashed #69c;
    }
    
    </style>
    </head>
    
    <body>
    <table width="520" border="1" cellpadding="0" cellspacing="0" id="table1">
    <script type="text/javascript">linkDisplay();</script>
    </table>
    </body>
    </html>

Similar Threads

  1. Replies: 5
    Last Post: 02-07-2011, 10:45 AM
  2. Replies: 7
    Last Post: 29-06-2011, 10:20 PM
  3. Link a Table to another Table to Drop Down In Main Table
    By himeshRES in forum Windows Software
    Replies: 6
    Last Post: 11-12-2010, 02:01 PM
  4. Replies: 5
    Last Post: 14-07-2010, 04:24 PM
  5. How to load XML program into SQL table using VB (or C#)
    By Laurense in forum Software Development
    Replies: 5
    Last Post: 23-01-2010, 09:44 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,280,128.97960 seconds with 17 queries