Hello and welcome to our community! Is this your first visit?
Register
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
    Jan 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using rowspan in <td>

    Hi, i am trying to display different information in a table cell occupying the same table cell position (a_position). Within the abc.js script, I have the following to display the values in a table cell. However, it seems like each time,
    I can only display one value per table cell, if I have more values occupying the same cell position, is it that i have to use rowspan to separate the information? Can anyone kindly advise?

    <HTML>
    <HEAD>
    <script language='javascript' src='abc.js'>
    </script>
    <TITLE></TITLE></HEAD>
    <BODY bgcolor=#498596 TEXT=#000000 LINK=##9932CC VLINK=#800080 onload = 'starttime_maxarray(830, 11)'>
    </HTML>

    //In javascript (abc.js)

    function starttime_maxarray(starttime1, maxarraysize1)
    {
    starttime=starttime1;
    maxarraysize=maxarraysize1;


    for (i=0;i<6;i++) //initial the array to empty cell(table)
    {
    for (j=0;j<maxarraysize;j++)
    {
    a_position=maxarraysize*i+j;
    all_classes[a_position]="&nbsp";
    all_classes_index[a_position]="";
    all_classes_wk[a_position] = "";
    }
    }
    }

    ...
    ...
    //store some values in all_classes[a_position]

    var a_position=10;

    all_classes[a_position] = E123(LT1)1;
    all_classes[a_position] = E456(LT4)2;
    ...


    for(i=0;i<6;i++)
    {
    for(j=0;j<maxarraysize;j++)
    {

    a_position = i * maxarraysize + j; //a_position = 65

    if (all_classes[a_position].substring(0,1)!="&")
    {

    space=parseInt(all_classes[a_position].substring((all_classes[a_position].length-1),all_classes[a_position].length))
    //space is to indicate the number of hours the lesson occupy

    if (maxarraysize > 10) //for full-time subjects
    writeln("<td rowspan=1 nowrap colspan="+space+">");

    else
    writeln("<td rowspan=1 nowrap colspan="+space+">");

    writeln(all_classes[a_position].substring(0,(all_classes[a_position].length-1)));

    writeln("</td>");
    j=j+space-1;
    }
    else // (all_classes[a_position].substring(0,1)=="&")
    {
    if (maxarraysize < 10) //for part-time subjects
    writeln("<td width=11% wrap>");
    else
    writeln("<td width=9% wrap>");

    writeln("&nbsp");
    writeln("</td>");
    }
    }
    writeln("</tr>");
    }
    writeln("</table>")

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Hm... If you need to separate the values on vertical lines, maybe the simpliest way is to insert a break line each value

    someting like

    var value = value+'<br>';
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

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