Columns and Rows

This is a discussion on "Columns and Rows" within the JavaScript Forum section. This forum, and the thread "Columns and Rows are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 18th, 2007, 00:15
New Member
Join Date: Oct 2007
Location: US
Age: 29
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Columns and 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..
HTML: Select all
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!

Last edited by c010depunkk; Nov 18th, 2007 at 02:05. Reason: please use [HTML] tags when posting HTML
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 19th, 2007, 17:56
Reputable Member
Join Date: Apr 2007
Location: Scotland
Age: 17
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Columns and Rows

What's with the huge ammounts of JS. Could this not be done with normal HTML?

I think what your trying to achieve should be done with CSS anyway.

Could we have a link to the web page please? It would help understand what's going on much better.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 19th, 2007, 18:01
New Member
Join Date: Oct 2007
Location: US
Age: 29
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Columns and Rows

Thanks for respond...
Here is the link...

http://whatamusic.com/upload_music/a...ernative_a.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Nov 20th, 2007, 02:41
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Columns and Rows

This seems to be an attempt at substituting for frames. Not a good idea! Use divs (which you already have) that are positioned and sized with css. If you don't know how, see this tutorial. It should explain the basics...

Cheers
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Nov 20th, 2007, 16:13
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Columns and Rows

I think that could be donw using PHP and AJAX.

btw, I don't think this is possible without PHP or CGI because
1. You need PHP/CGI to handle uploads
2. AJAX to refresh the contents dynamically.
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Placing pictures in rows casho Website Planning 9 Nov 29th, 2007 17:46
mimic table rows flann Web Page Design 5 Apr 13th, 2007 23:30
IE Fast rows insertion. ronen JavaScript Forum 1 Mar 21st, 2007 22:51
Customizing table rows AdRock Web Page Design 2 Aug 28th, 2006 09:28
multiple rows => 1row??? ktsirig PHP Forum 1 Dec 31st, 2005 21:30


All times are GMT. The time now is 01:59.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42