SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 27

Thread: Column*rows

  1. #1
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Column*rows

    Hi,

    I try to make a table with at least 3Columns* 3 Rows.
    the table is when I upload the picture, the first picture would go to
    first column/ first row...
    Second pictures would go second column/first row
    Third one go third column/first row...
    Fourth would go first column/second row...so so on..
    I got the code here..
    ------------------------------------------------------------------------------------
    var Urls = new Array();
    var Imgs = new Array();

    function showTags(theTag,thePlace) {

    function getTag(tag) {
    var tmp='';
    xx=x[i].getElementsByTagName(tag);
    try { tmp=xx[0].firstChild.data; }
    catch(er) { tmp=''; }
    return(tmp);
    }

    var xx; var x; var txt;
    x = xmlDoc.getElementsByTagName(theTag);
    txt='<table border="0" cellPadding="2" width="210">';

    for (i=0; i<x.length; i++) {
    Urls[i]=getTag("location"); Imgs[i]=getTag("image"); //getTag("title"); getTag("creator"); getTag("info");

    txt+='<tr><td><table width="295" onclick="play('+i+')" class="playlistlo" onmouseover="this.className = \'playlisthi\';" onmouseout="this.className = \'playlistlo\';"><tr>';
    txt+='<td><img src="'+getTag("image")+'" width="90" height="90" border="1" alt="Click to Play"></td><td width="200" valign=top>';
    txt+='<p><br>&nbsp;<b>'+getTag("title")+'</b><br>';
    txt+='&nbsp;by: '+getTag("creator")+'<br>';
    txt+='&nbsp;<a href="'+getTag("info")+'" target="_blank">Download it!</a></p>';
    txt+='</td></tr></table></td></tr>';
    }
    txt+="</table>";

    document.getElementById(thePlace).innerHTML=txt;
    }

    ---------------------------------------------------------------------------------------

    It just go One column now..how can I modify to to want I want..
    Thanks!

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    layout

    Ah, the problems associated with using table for layout.
    What does the created mark-up (in bbtags please) look like?

  3. #3
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    thanks for respond.
    Here is that page looks like:

    http://www.whatamusic.com/upload_mus...ernative_a.htm

    Please help me..thanks!

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    mark-up

    Well, the good news is the script does at least create well formed mark-up.
    HTML Code:
    <div id="writeroot">
    <!-- script generated txt='<table border="0" cellPadding="2" width="210">'; -->
      <table border="0" cellpadding="2" width="210">
    <!-- script generated for-loop txt+='<tr> .... </tr>'; -->
        <tr>
          <td>
          <table onclick="play(0)" class="playlistlo" onmouseover="this.className = 'playlisthi';" onmouseout="this.className = 'playlistlo';" width="295">
            <tr>
              <td>
              <img Src="Tien_-_A.jpg" alt="Click to Play">
              </td>
              <td valign="top" width="200">
              <p><br>&nbsp;<b>1. A</b><br>&nbsp;by: Tien<br>&nbsp;<a href="Tien_-_A.mp3">Download it!</a></p>
              </td>
            </tr>
          </table>
          </td>
        </tr>
    <!-- more rows follow -->
    <!-- script generated txt+='</table>'; -->
      </table>
    </div> <!-- end #writeroot -->
    As it is now, it makes a table with each row containing 1 cell with another table it. What you want is a table with each row containing 3 cells with another table it? If so, will the number of images always be in multiples of 3?

  5. #5
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, thanks for respond...
    but I am not a natvie speaker, and know nothing about the javascript...
    could you teach me how to do this..?

    Do I just copy and paste what you post to my javascript and it will work...?

    Yes, I want each row has 3 cells, but not always 3, because I would let other users to upload their stuff in my website, so it depends on how many people uploading.

  6. #6
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I try to add your code to my file...but it doesn't work...

    like this
    HTML Code:
    <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
    <!--
    var xmlhttp;
    var xmlDoc;
    
    function loadXMLDoc(theFile) {
      xmlhttp=null;
      if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } 
      else if (window.ActiveXObject) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
    
      if (xmlhttp!=null) {
        xmlhttp.onreadystatechange=loaded;
        xmlhttp.open("GET",theFile,true);
        xmlhttp.send(null);
      } else { alert('Sorry, your browser can\'t handle this script'); return; }
    }
    
    function checkReadyState(obj) {
      if(obj.readyState == 4) {
        if(obj.status == 200) { return true; }
        else { alert("Problem retrieving XML data"); }
      }
    }
    
    function loaded() {	
      if(checkReadyState(xmlhttp)) {
        xmlDoc=xmlhttp.responseXML.documentElement;
        showTags('track','writeroot');
        createPlayer(Urls[0], Imgs[0], false, true);
      }
    }
    
    
    var Urls = new Array();
    var Imgs = new Array();
    
    function showTags(theTag,thePlace) {
    
      function getTag(tag) { 
        var tmp='';
        xx=x[i].getElementsByTagName(tag);     
        try { tmp=xx[0].firstChild.data; } 
        catch(er) { tmp=''; }    
        return(tmp); 
      }
    
      var xx; var x; var txt;
      x = xmlDoc.getElementsByTagName(theTag);
      txt='<table border="0" cellPadding="2" width="210">'; 
    
      for (i=0; i<x.length; i++) { 
        Urls[i]=getTag("location"); Imgs[i]=getTag("image");  //getTag("title"); getTag("creator"); getTag("info");
    
        txt+='<tr><td><table width="295" onclick="play('+i+')" class="playlistlo" onmouseover="this.className = \'playlisthi\';" onmouseout="this.className = \'playlistlo\';"><tr>';
        txt+='<td><img src="'+getTag("image")+'" width="90" height="90" border="1" alt="Click to Play"></td><td width="200" valign=top>';
        txt+='<p><br>&nbsp;<b>'+getTag("title")+'</b><br>';
        txt+='&nbsp;by: '+getTag("creator")+'<br>';
        txt+='&nbsp;<a href="'+getTag("info")+'" target="_blank">Download it!</a></p>';
        txt+='</td></tr></table></td></tr>';
      }
      txt+="</table>";
    
      document.getElementById(thePlace).innerHTML=txt; 
    }
    
    
    var thePlayer;
    var thePlayerRoot;
    var theList;
    var theListRoot;
    
    function initialize() {
    	thePlayer = document.getElementById("playerhandle");
    	theList = document.getElementById("listhandle");
    	thePlayerRoot  = document.getElementById("playerroot");
    	theListRoot  = document.getElementById("listroot");
    	//Drag.init(thePlayer, thePlayerRoot);	
    	//Drag.init(theList, theListRoot);
    }
    
    function createPlayer(theFile, theImg, start, icons) {
    	var s1 = new SWFObject("mediaplayer.swf","dragplayer","220","220","7");
    	s1.addParam("allowfullscreen", "true");
    	s1.addVariable("file", theFile);
    	s1.addVariable("width", "220");
    	s1.addVariable("height", "220");
    	s1.addVariable("displaywidth", "220");
    	s1.addVariable("displayheight", "220");
    	if (start) s1.addVariable("autostart", "true");
    	if (! icons) s1.addVariable("showicons", "false");
    	if (theImg != "") s1.addVariable("image", theImg);
    
    	s1.write("placeholder");
    }
    
    function play(number) { 
      createPlayer(Urls[number], Imgs[number], true, true);
    }
    
    // -->
    </SCRIPT>
    </HEAD>
    
    <BODY onLoad="initialize(); loadXMLDoc('playlist_alternative_a.xml');">
    <DIV id="playerroot" style="LEFT: 0px; TOP: 25px">
    <DIV id="playerhandle"></DIV>
    <DIV id="placeholder"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</DIV>
    </DIV>
    
    <DIV id="listroot" style="LEFT: 230px; TOP: 0px">
    <DIV id="listhandle"></DIV>
    <DIV class="playlistbox" align="center" style="PADDING-TOP:8px; MARGIN: 0px; OVERFLOW: auto; WIDTH: 320px; HEIGHT: 270px">
    <DIV id="writeroot"><!-- script generated txt='<table border="0" cellPadding="2" width="210">'; -->
      <table border="0" cellpadding="2" width="210">
    <!-- script generated for-loop txt+='<tr> .... </tr>'; -->
        <tr>
          <td>
          <table onclick="play(0)" class="playlistlo" onmouseover="this.className = 'playlisthi';" onmouseout="this.className = 'playlistlo';" width="295">
            <tr>
              <td>
              <img Src="Tien_-_A.jpg" alt="Click to Play">
              </td>
              <td valign="top" width="200">
              <p><br>&nbsp;<b>1. A</b><br>&nbsp;by: Tien<br>&nbsp;<a href="Tien_-_A.mp3">Download it!</a></p>
              </td>
            </tr>
          </table>
          </td>
        </tr>
    <!-- more rows follow -->
    <!-- script generated txt+='</table>'; -->
      </table>
    </div> <!-- end #writeroot --></DIV>
    </DIV></DIV>
    
    </BODY>
    </HTML>

  7. #7
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think what I want is

    1. column 1, row 1
    2.column 2 row 1
    3.column 3, row 1
    4.colum 1, row 2
    5.column 2, row 2
    6.column 3, row 2
    7. column 1, row 3
    8. column 2, row 3
    9. column 3, row 3
    10. column 1, row 4
    11. column 2, row 4

    Only three columns..but maybe at least 10 rows...

    thanks!

  8. #8
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    posted mark-up

    The mark-up I posted was not meant to be copy-pasted to your page. It is the mark-up that the javascript code is adding to the page already as it is now. That is, the page already has that in it (from the javascript). I posted it to give a better understanding of the mark-up.
    Right now the script creates a table like this
    HTML Code:
    <table>
      <tr>
        <td>
        <table>
          <tr>
            <td>
            <img>
            </td>
            <td>
            <p><a></a></p>
            </td>
          </tr>
        </table>
        </td>
      </tr>
    </table>
    but you want it to be like
    HTML Code:
    <table>
      <tr>
        <td>
        <table>
          <tr>
            <td>
            <img>
            </td>
            <td>
            <p><a></a></p>
            </td>
          </tr>
        </table>
        </td>
        <td>
        <table>
          <tr>
            <td>
            <img>
            </td>
            <td>
            <p><a></a></p>
            </td>
          </tr>
        </table>
        </td>
        <td>
        <table>
          <tr>
            <td>
            <img>
            </td>
            <td>
            <p><a></a></p>
            </td>
          </tr>
        </table>
        </td>
      </tr>
    <!-- more rows of 3 cells -->
    </table>
    The part of the javascript that needs to be changed is
    HTML Code:
        txt+='<tr><td><table width="295" onclick="play('+i+')" class="playlistlo" onmouseover="this.className = \'playlisthi\';" onmouseout="this.className = \'playlistlo\';"><tr>';
        txt+='<td><img src="'+getTag("image")+'" width="90" height="90" border="1" alt="Click to Play"></td><td width="200" valign=top>';
        txt+='<p><br>&nbsp;<b>'+getTag("title")+'</b><br>';
        txt+='&nbsp;by: '+getTag("creator")+'<br>';
        txt+='&nbsp;<a href="'+getTag("info")+'" target="_blank">Download it!</a></p>';
        txt+='</td></tr></table></td></tr>';
    IMHO it would be helpful to break this apart into more lines of code first
    HTML Code:
        txt+='<tr>';
    txt+='<td><table width="295" onclick="play('+i+')" class="playlistlo" onmouseover="this.className = \'playlisthi\';" onmouseout="this.className = \'playlistlo\';"><tr>';
        txt+='<td><img src="'+getTag("image")+'" width="90" height="90" border="1" alt="Click to Play"></td><td width="200" valign=top>';
        txt+='<p><br>&nbsp;<b>'+getTag("title")+'</b><br>';
        txt+='&nbsp;by: '+getTag("creator")+'<br>';
        txt+='&nbsp;<a href="'+getTag("info")+'" target="_blank">Download it!</a></p>';
        txt+='</td></tr></table></td>';
    txt+='</tr>';
    then add in conditional tests to format things the way you want them. There may be a way to use modulus to make the code more scalable, but you really don't want too many (slower page loading) do you?
    HTML Code:
    if((i == 0)||(i == 3)||(i == 6)){txt+='<tr>';}
    txt+='<td><table width="295" onclick="play('+i+')" class="playlistlo" onmouseover="this.className = \'playlisthi\';" onmouseout="this.className = \'playlistlo\';"><tr>';
        txt+='<td><img src="'+getTag("image")+'" width="90" height="90" border="1" alt="Click to Play"></td><td width="200" valign=top>';
        txt+='<p><br>&nbsp;<b>'+getTag("title")+'</b><br>';
        txt+='&nbsp;by: '+getTag("creator")+'<br>';
        txt+='&nbsp;<a href="'+getTag("info")+'" target="_blank">Download it!</a></p>';
        txt+='</td></tr></table></td>';
    if((i == 2)||(i == 5)||(i == 8)){txt+='</tr>';}
    Last edited by Mittineague; Nov 18, 2007 at 11:33. Reason: fixing error

  9. #9
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool...thanks a lot!
    It now looks like this :
    http://www.whatamusic.com/upload_mus...ernative_d.htm

    so there are 5, so the 5th would be in the second column but Second Row?

    Could you change it to fill first row first, and then fill second row..?
    I tried a little bit..but it did not work..

    Thanks so much.
    I really appreciated you help...

  10. #10
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    mistake

    Sorry, I had a mistake in the example. The closing tr line should be
    HTML Code:
    if((i == 2)||(i == 5)||(i == 8)){txt+='</tr>';}
    As it is, the code will work OK as long as the images are always in multiples of 3
    But if there isn't, the mark-up will be broken. eg. (3, 6, 9 ... etc will be)
    <tr><td></td><td></td><td></td></tr>
    but (1, 4, 7 ... etc will be)
    <tr><td></td>
    and (2, 5, 6 ... etc will be)
    <tr><td></td><td></td>
    so there needs to be some way to add empty cells to fill out any partial rows and add the closing tr tag.

    I have to go for a while, but work on it and post what changes you come up with and I'll check it for you when I get back.

  11. #11
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks alot.
    It really work very very well.
    You can see in this page:
    http://www.whatamusic.com/upload_mus...ernative_e.htm

    In theory, I can add hundreds of thousand's rows when I keep upload the files there, right?

    Can I also add the "next page" there where it's over 30 files...? But I think it's different work...

    THANK YOU SO MUCH!

  12. #12
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    By the way,
    Could we let the NEWEST UPLOAD to the First column and First row..?

    Thanks!

  13. #13
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    more files

    If you are going to have more files, you will need to modify the code to handle it. You could add to the conditionals in increments of 3. ie.
    if((i == 0)||(i == 3)||(i == 6)){txt+='<tr>';}
    would become
    if((i == 0)||(i == 3)||(i == 6)||(i == 9)||(i == 12)||(i == 15)||(i == 18)||(i == 21)||(i == 24)||n#...........){txt+='<tr>';}
    which as you can see will become code bloat very easily, especially more so the more you want to have. - "hundreds of thousand's"
    But I think using modulus should work OK. maybe something like
    HTML Code:
    if((i == 0)||(i%3 == 0)){txt+='<tr>';}
    Similar lines using modulus should work in your code for the closing tag and the "not 3" rows too.

    For "More ..." links you need some type of pagination code, which can be a bit involved. It may be easier to use categories instead.

    As for the order, eg. newest first, you could change the order in the source XML file
    Code XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <playlist version='1' xmlns='http://xspf.org/ns/0/'>
     <trackList>
     
    	<track>
    		<title>1. A</title>
    		<creator>Tien</creator>		<location>http://www.whatamusic.com/upload_music/alternative/files_alternative_a/Tien_-_A.mp3</location>
    		<info>dl_alternative_a.php?file=Tien_-_A.mp3</info>
    		<image>http://www.whatamusic.com/upload_music/alternative/images_alternative_a/Tien_-_A.jpg</image>
    	</track>
     
    	<track>
    		<title>2. HaHa</title>
    		<creator>Tien</creator>		<location>http://www.whatamusic.com/upload_music/alternative/files_alternative_a/Tien_-_HaHa.mp3</location>
    		<info>dl_alternative_a.php?file=Tien_-_HaHa.mp3</info>
    		<image>http://www.whatamusic.com/upload_music/alternative/images_alternative_a/Tien_-_HaHa.jpg</image>
    	</track>
    <!-- more tracks -->
    </trackList>
    </playlist>

  14. #14
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for respond...

    I don't understand what you mean by "use categories instead"...how..?

    I know I can modify the XML file, but if I have more than hundreds of songs which uploaded by my members, it's impossible for me to modify manually.
    Is there any way to modify your codes to do this.

    I apprecaited your help.

  15. #15
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    changing order

    By categories, I mean instead of having 1 "everything", make individual pages for each "group". For example "really fast, fast, medium, slow, very slow" or "really long, long, medium, short, really short" or "jazz, blues, rock, pop, country" or "October 2007, November 2007, December 2007" etc. What you use would depend on how you wanted to categorize them.

    I guess you could change the for loop. Instead of
    HTML Code:
      for (i=0; i<x.length; i++) {
    maybe
    HTML Code:
      for (i = x.length-1; i > -1; i--) {

  16. #16
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Thanks, I would try the new code tonight and let you know it works or not...

    I already make the gategory like "Jazz, Rock...."
    And I afraid that there are too much in one category, such as too much song in "Rock".

    So I want to add the page 1, 2, 3, 4.
    Maybe I could add the sub-category in the "Rock", such as December..or something..But just need to do it manually...kind of stupid..don't you think so...?

  17. #17
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    collection

    I suppose pagination will become neccessary at some point no matter what. You don't want to have any pages that take forever to load. And as long as users can do a search rather than hunt for something specific in a long collection it should be OK.

    As for the code working, changing the for loop will reverse the order, but don't forget that you will need to change the if conditionals for it to do the row-column stuff as the i values will be reversed too.

  18. #18
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you mean like this..?

    if((i == 6)||(i == 3)||(i == 0)){txt+='<tr>';}

  19. #19
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    if conditionals

    HTML Code:
    if((i == 6)||(i == 3)||(i == 0)){txt+='<tr>';}
    AFAIK, that will only work if the number of tracks is 7
    IMHO the best way to do it with the newest first would be to make a new variable for the if tests and increment it at the end of the loop. ie.
    HTML Code:
    var j = 0;
    for (var i = x.length-1; i > -1; i--) {
       Urls[i]=getTag("location"); Imgs[i]=getTag("image"); // getTag("title"); getTag("creator"); getTag("info");
       if( (j == 0) || (j&#37;3 == 0) ) { txt+='<tr>\n'; }
       txt+='<td>\n<table width="295" onclick="play('+i+')" class="playlistlo" onmouseover="this.className = \'playlisthi\';" onmouseout="this.className = \'playlistlo\';">\n<tr>\n';
       txt+='<td>\n<img src="'+getTag("image")+'" width="90" height="90" border="1" alt="Click to Play">\n</td>\n<td width="200" valign=top>\n';
       txt+='<p><br>\n&nbsp;<b>'+getTag("title")+'</b><br>\n';
       txt+='&nbsp;by: '+getTag("creator")+'<br>\n';
       txt+='&nbsp;<a href="'+getTag("info")+'" target="_blank">Download it!</a>\n</p>\n';
       txt+='</td>\n</tr>\n</table>\n</td>\n';
       if( (j == 2) || (j%3 == 2) ) { txt+='</tr>\n'; }
    /* your row filler stuff here should use the var j too */
       j++;
    }

  20. #20
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got it work! http://whatamusic.com/upload_music/a...ernative_f.htm
    Thanks a lot!

    HTML Code:
    for (i = x.length-1; i > -1; i--) {
        Urls[i]=getTag("location"); Imgs[i]=getTag("image");  //getTag("title"); getTag("creator"); getTag("info");
    
        if((i == 6)||(i == 3)||(i == 0)){txt+='<tr>';}
        txt+='<td><table width="220" onclick="play('+i+')" class="playlistlo" onmouseover="this.className = \'playlisthi\';" onmouseout="this.className = \'playlistlo\';"><tr>';
        txt+='<td><img src="'+getTag("image")+'" width="90" height="90" border="1" alt="Click to Play"></td><td width="200" valign=top>';
        txt+='<p><br>&nbsp;<b>'+getTag("title")+'</b><br>';
        txt+='&nbsp;by: '+getTag("creator")+'<br>';
        txt+='&nbsp;<a href="'+getTag("info")+'" target="_blank">Download it!</a></p>';
        txt+='</td></tr></table></td>';
      if((i == 7)||(i == 4)||(i == 1)){txt+='</tr>';}  }
      txt+="</table>";

  21. #21
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I don't know what's the different between yours and mine.
    but I think yours sould be better than mine with no doubt.

    Is yours could be used in a larger number of files than mine?
    Thanks!

  22. #22
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    table layout

    I'm not sure what's going on. The way I see it, if there are more than 7 tracks, ie 10, the mark-up should be messed looking something like
    <table>
    <td></td><td></td><td></td><td></td>
    <tr><td></td><td></td><td></td></tr>
    <tr><td></td><td></td><td></td></tr>
    </table>
    Yet in firebug, the mark-up looks well formed and the page is rendered OK, so maybe the browser fixes (deduces where the columns and rows should be) the table structure errors?
    Anyway, as I posted earlier, if you use if (i == #) you will need to account for every possible #. Using modulus solves the problem, although it may not be as clear as using the actual numbers.

  23. #23
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    um..I still don;t understand what you mean..sorry, I am not a native speaker....but it works great now..I already upload 11 mp3 there...everything is great...
    Thanks!

  24. #24
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    works great?

    Quote Originally Posted by tlo5
    but it works great now
    If you look closely, you'll see that #8 is not included. Unless this it what you intended, I suggest you try the code I last posted instead.

  25. #25
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah..
    I already changed it to your code.
    And it looks great..check this
    http://whatamusic.com/upload_music/a...ernative_i.htm

    By the way, I went to your personal website and sent you a message, did you receive it...?


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
  •