Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
table or css layout for this kind of webpage?
Old 03-19-2009, 10:07 AM table or css layout for this kind of webpage?
Experienced Talker

Posts: 38
Trades: 0
Hi guys,

I'm just wondering whether if this kind of webpage is suitable for table or the css div layout? it's not simple data but a lot of images on the left and descriptions on the right as well as 2 columns by multiple rows.

http://www.h2ogeek.com/divegear/index2.html

my next question is, if it is css, would you be able to guide me with the coding for css on the layout? at least for the first few rows?

your feedback is much appreciated,

thank you very much.

Last edited by superkingkong; 03-19-2009 at 10:13 AM..
superkingkong is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-19-2009, 10:16 AM Re: table or css layout for this kind of webpage?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Either.

A layout using CSS styled divs would certainly have much less code overhead than a table based layout would.

Personally I would use a div layout.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-19-2009, 09:26 PM Re: table or css layout for this kind of webpage?
Experienced Talker

Posts: 38
Trades: 0
thanks for your opinion.

and would you mind to guide me on the code for like 2 columns and few rows? or do you know where can i get some links as examples? i'm just a beginner on CSS.

thanks
superkingkong is offline
Reply With Quote
View Public Profile
 
Old 03-20-2009, 07:22 AM Re: table or css layout for this kind of webpage?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Off the top of my head;
Code:
.row {
	position:relative;
}
.p_image {
	width:40%;
	float:left;
}
.p_descript {
	clear:right;
	width:auto;
}
HTML Code:
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-20-2009, 06:29 PM Re: table or css layout for this kind of webpage?
Experienced Talker

Posts: 38
Trades: 0
thanks a lot

really appreciate it

a small problem though, since the description is more than the images in terms of height, the description "wraps" around the images to the left. how can i prevent that?

oh, fyi, i did a div text-align:center the div row and text-align:left on both p_images and p_descript. i want to center the "table" but left align the contents. will these cause the "text wrap around"?

also, is it possible for me to "vertical align" the images for that row? do i just specify vertical-align: middle; in the .p_image ?

thanks in advance for your help

Last edited by superkingkong; 03-20-2009 at 06:50 PM..
superkingkong is offline
Reply With Quote
View Public Profile
 
Old 03-20-2009, 07:14 PM Re: table or css layout for this kind of webpage?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
also, is it possible for me to "vertical align" the images for that row? do i just specify vertical-align: middle; in the .p_image
vertical-align doesn't work the way everybody thinks it should work
http://www.candsdesign.co.uk/referen...ertical-align/
It only applies to inline elements.

slight change to make the heights work ok;

Code:
.row {
	position:relative;
	clear:both;
	margin-bottom:5px;
	overflow:auto;
}
.p_image {
	width:40%;
	float:left;
}
.p_descript {
	float:right;
	width:55%;
}
.clearing {
	clear:both;
}
HTML Code:
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-20-2009, 07:15 PM Re: table or css layout for this kind of webpage?
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
The text 'wrapping' is happening because the image is FLOATED to the left, the text is doing exactly what it's supposed to do under those conditions.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-20-2009, 08:00 PM Re: table or css layout for this kind of webpage?
Experienced Talker

Posts: 38
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Code:
.clearing {
    clear:both;
}
HTML Code:
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
<div class="row">
<div class="p_image">Images</div>
<div class="p_descript">Description</div>
</div>
thanks for the code, where do i use the class "clearing"? do i just declare it in css?

thanks for the explanation, LadynRed
superkingkong is offline
Reply With Quote
View Public Profile
 
Old 03-20-2009, 08:08 PM Re: table or css layout for this kind of webpage?
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
It would be used after you have floated an element and what you want to wrap around it has. LNR has actually gotten me in the habit of using a <br /> with class brclear, with the following rules:

.brclear{clear:both; margin:0; padding:0; line-height:0;}

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 03-20-2009, 08:29 PM Re: table or css layout for this kind of webpage?
Experienced Talker

Posts: 38
Trades: 0
spam in the forum??

hi serandfae,

don't quite get you :P i'm still a novice :P

i thought once you close the /div, it will be cleared, no?
superkingkong is offline
Reply With Quote
View Public Profile
 
Old 03-20-2009, 08:35 PM Re: table or css layout for this kind of webpage?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
I've got out of the "clearing" div habit (almost). Adding overflow: auto; to the container will clear the floats as well
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-20-2009, 08:42 PM Re: table or css layout for this kind of webpage?
serandfae's Avatar
Do the "Evil Nanner" !!!

Posts: 8,936
Name: Tim Daily
Location: Apex, NC, US, Sol 3
Trades: 0
LnR also posted a sticky on that subject in this forum:

http://www.webmaster-talk.com/css-fo...you-clear.html

But if you choose the clearing div or br path, realize that whatever element you want to float is first in your HTML. (That is, make sure it's in the HTML before what you float around it.) Then after the elements that float around it have done so, put in the clearing element before you put in anything else.

tim
__________________
SEO "experts" smell like Big Fish_|_
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by serandfae; 03-21-2009 at 01:46 AM.. Reason: clarification
serandfae is offline
Reply With Quote
View Public Profile Visit serandfae's homepage!
 
Old 03-27-2009, 06:27 PM Re: table or css layout for this kind of webpage?
Experienced Talker

Posts: 38
Trades: 0
thanks for the userful code. It helps me a lot

i have another question :P

the output for this code is

--------------------------------
content left | content right
content left | content right
&nbsp;&nbsp;| content right
--------------------------------
content left | content right
content left | content right
content left |
--------------------------------

how can i specify a vertical border to divide left content and right content? similar to a table.

as u can see, sometimes my right content is more, sometimes, the left is more. when floating left and right, they don't "meet" with each other, when i float left for both and specify the border, i'll end up with 2 visible borders. if i specify just 1 border, either left or right div, and since the heights are different, for some rows, it will end up with short vertical border.

appreciate if you can provide further guidance, thanks.
superkingkong is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to table or css layout for this kind of webpage?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.42315 seconds with 12 queries