Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old April 7th, 2007, 07:11 AM   #1
New Member
 

Join Date: Apr 2007
Location: London
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 rosh1e is on a distinguished road
Forcing a 3 row layout dynamically

Hi,

Does anyone know how I can force my table to be in a 3 row format with the number of columns created dynamically. As I would like items to be displayed in a fixed div. However I want them to be able to scroll through the table with horizontal as opposed to vertical scroll bars. When I've tried it, it comes out in a 3 column format, with the 4th row hidden from view.

In summary I would like a new column to be created for every 4th item. I have done this using tables, but I was told that I was using too many as each item was wrapped in a table which was in turn wrapped in a table cell, which when the number of cells created hit 4 a new column was created. Here's a static version of what I had orignally:

Code:
<table bgcolor="#FFFDFD" cellspacing="3">
<tr>
<td>
<table>
<tr>
<td>
<div id="mainpicture" onMouseOver='document.getElementById("picturedetails").style.visibility = 
"visible";' onMouseOut='document.getElementById("picturedetails").style.visibility = "hidden";'>
<a href=""><img src ="../images/products/dresses/dr10164bluefront.jpg" border=0 height="160" width= 
"120" /></a> 
</div>
<div id="picturedetails" onMouseOver='document.getElementById("picturedetails").style.visibility = 
"visible";' onMouseOut='document.getElementById("picturedetails").style.visibility = "hidden";'>
Hello you please work 
<br />Yes
<br />yes
</div> 
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<div id="mainpicture" onMouseOver='document.getElementById("picturedetails").style.visibility = 
"visible";' onMouseOut='document.getElementById("picturedetails").style.visibility = "hidden";'>
<a href=""><img src ="../images/products/dresses/dr10109blackfront.jpg" border=0 height="160" width= 
"120" /></a> 
</div>
<div id="picturedetails" onMouseOver='document.getElementById("picturedetails").style.visibility = 
"visible";' onMouseOut='document.getElementById("picturedetails").style.visibility = "hidden";'>
Hello you please work 
<br />Yes
<br />yes
</div> 
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<div id="mainpicture" onMouseOver='document.getElementById("picturedetails").style.visibility = 
"visible";' onMouseOut='document.getElementById("picturedetails").style.visibility = "hidden";'>
<a href=""><img src ="../images/products/dresses/dr10173brownfront.jpg" border=0 height="160" width= 
"120" /></a> 
</div>
<div id="picturedetails" onMouseOver='document.getElementById("picturedetails").style.visibility = 
"visible";' onMouseOut='document.getElementById("picturedetails").style.visibility = "hidden";'>
Hello you please work 
<br />Yes
<br />yes
</div> 
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<div id="mainpicture" onMouseOver='document.getElementById("picturedetails").style.visibility = 
"visible";' onMouseOut='document.getElementById("picturedetails").style.visibility = "hidden";'>
<a href=""><img src ="../images/products/dresses/dr10198greyfront.jpg" border=0 height="160" width= 
"120" /></a> 
</div>
<div id="picturedetails" onMouseOver='document.getElementById("picturedetails").style.visibility = 
"visible";' onMouseOut='document.getElementById("picturedetails").style.visibility = "hidden";'>
Hello you please work 
<br />Yes
<br />yes
</div> 
</td>
</tr>
</table>
</td>
</tr>
Hope that makes sense, I'd like to know the most efficient way to do this and any help would be appreciated as I'm stuck.

Thank you in advance

Last edited by karinne; April 7th, 2007 at 09:30 AM.. Reason: Please use [code]...[/code] tags when displaying code!
rosh1e is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 7th, 2007, 07:39 AM   #2
Elite Veteran
 
Ryan Fait's Avatar
 

Join Date: May 2006
Location: Las Vegas
Posts: 3,784
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough
Re: Forcing a 3 row layout dynamically

A server side language is the only way to do something like that. PHP or ASP for example.
Ryan Fait is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 7th, 2007, 08:02 AM   #3
New Member
 

Join Date: Apr 2007
Location: London
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 rosh1e is on a distinguished road
Re: Forcing a 3 row layout dynamically

Hi,

Thanks for your reply, I understand that, but how do I go about forcing the table to be created in three rows?
rosh1e is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 7th, 2007, 08:55 AM   #4
Elite Veteran
 
Ryan Fait's Avatar
 

Join Date: May 2006
Location: Las Vegas
Posts: 3,784
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough
Re: Forcing a 3 row layout dynamically

I suggest you either learn PHP or hire someone to code what you want.
Ryan Fait is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 7th, 2007, 09:01 AM   #5
New Member
 

Join Date: Apr 2007
Location: London
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 rosh1e is on a distinguished road
Re: Forcing a 3 row layout dynamically

I know how to use PHP and like I said I was able to achieve it with tables, but I haven't been able to acheive it with CSS... I just needed a little advice that's all.

Thanks anyway... I'll get there in the end
rosh1e is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 7th, 2007, 09:10 AM   #6
Elite Veteran
 
Ryan Fait's Avatar
 

Join Date: May 2006
Location: Las Vegas
Posts: 3,784
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough Ryan Fait is a jewel in the rough
Re: Forcing a 3 row layout dynamically

Perhaps I don't understand what you want. The word "dynamic" should never be used in the same sentence as CSS. I'm assuming you know very little about CSS; the fact that you're using tables is enough to bring me to that conclusion. Could maybe post a link, an attachment or even a more descriptive question?
Ryan Fait is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 7th, 2007, 09:24 AM   #7
New Member
 

Join Date: Apr 2007
Location: London
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 rosh1e is on a distinguished road
Re: Forcing a 3 row layout dynamically

Hi,

Ok, maybe I'm not making myself clear at all, but basically this is what I'm trying to achieve

http://www.shesjustgottohaveit.com/N...ies.php/offers

Although I have decided to change the design, the layout will basically be the same. What I would like is for each time a users mouse hovers over the image a semi transparent layer appears showing the items details. Also I wanted to make sure that the items can be scrolled horizontally.

I hope this makes more sense now.

Thank you once again

PS this is what I have used in my PHP file

Code:
  <div id = "itemcontainer">
    <div id = "itempicture">
     <?
      echo "<a href='/productdetails.php/$productcode/$bestcolourname/'><img src='$picture' height='148' width='111' border='0'></img></a>"; 
            ?>    
    </div>
    <div id = "itemdetails">
   <b><font color="#666666">Polka Dot Wrap Dresss</b>
   <br />
   <br />Available in Green, Blue, Black & Orange
   <br />Price £20.00</font>
    </div>
    
  </div>
And the CSS
Code:
#items{height: 500px; width: 600px;}
#itemcontainer{ width: 148px; height: 148px; background-color:#FFFFFF; float: left;}
#itempicture { position:relative; top:0; left:0;   width: 148px; height: 148px; background-color: #ffffff; z-index:1;}
#itemdetails {background-color:#FFFFFF ; height:70px; width:148px; filter:alpha(opacity=75);-moz-opacity:.75;opacity:.75; position:relative; margin-top: -100px; z-index:2;}

Last edited by karinne; April 7th, 2007 at 09:31 AM.. Reason: Please use [code]...[/code] tags when displaying code!
rosh1e is offline  
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

Bookmarks

Tags
css , tables


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Forcing JavaScript to load before images? JennyChaos Your Design and Layout 14 July 13th, 2007 07:02 PM
Is it possible to set the FOCUS() dynamically with javascript AJAY KUMAR JavaScript 2 July 8th, 2007 11:29 PM
Forcing a vertical scrollbar cyberseed HTML, XHTML and CSS 6 July 5th, 2007 05:04 PM
Changing URLs dynamically - is this possible? fallen_angel HTML, XHTML and CSS 8 May 16th, 2006 07:31 PM
Insert code dynamically djme HTML, XHTML and CSS 21 November 26th, 2005 12:38 PM


Search Engine Optimization by vBSEO 3.2.0 RC8