Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-20-2010, 03:09 PM   #1
Jakez
Confirmed User
 
Jakez's Avatar
 
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
Anyone want to argue CSS vs TABLES for this?

Let's say you want to GENERATE the following type of structure from 12 rows of MySQL data using PHP and a horizontal columns number that can be changed by the webmaster (set to 4 here):



CSS
1: As far as I know, you'd need to know the exact px width of the 'container' and then divide that by the amount of box's (columns) that are set, as well as subtracting paddings, borders, etc., which sounds really messy IMO. Uh oh, what if the person set it to 5 instead of 4? Do a bunch of math in PHP to figure out the new correct width? But then how do you set the 'container' width in your .css file to match the new width?

2: Don't use a 'container' and just spit out 12 <div>'s one after another, use PHP to put a <br> after every 4 columns, or 5, whatever is set? But you have to eventually place this into some kind of 'container' in your layout which is going to have a set width. Fuck.

Tables
1: First lay down <table><tr>, then loop through the 12 rows of MySQL data placing </tr><tr> after every 4 or 5, then put </tr></table> after all that is done. Except if you check the source of the page you will have an empty <tr></tr> at the end.

And then both of these become a LOT more confusing when you try to implement a template system. How do you know whether to use <br> or </tr><tr> since you don't know whether the persons page is created with CSS or Tables?
__________________
[email protected] - jakezdumb - 573689400

Killuminati
Jakez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2010, 04:03 PM   #2
JD
Too lazy to set a custom title
 
Industry Role:
Join Date: Sep 2003
Posts: 22,651
for containing/displaying data, tables are a proper way to do it. That's what tables are for.

CSS is more of site/page structure and tables are for data containers (name/address/colors/shapes/etc)
JD is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2010, 04:07 PM   #3
Jakez
Confirmed User
 
Jakez's Avatar
 
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
Quote:
Originally Posted by JD View Post
for containing/displaying data, tables are a proper way to do it. That's what tables are for.

CSS is more of site/page structure and tables are for data containers (name/address/colors/shapes/etc)
Aren't all of your designs done in tableless CSS? What do you think would be the best or most valid method for displaying columns like this dynamically in CSS?

For example: http://www.monstersofblog.com/port/adulttube.jpg

What kind of structure do you use to place 4 in each row? Does it just push them into a new row because 4 of them reaches the exact width of the container?
__________________
[email protected] - jakezdumb - 573689400

Killuminati

Last edited by Jakez; 03-20-2010 at 04:11 PM..
Jakez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2010, 04:25 PM   #4
webboy21
Confirmed User
 
Industry Role:
Join Date: Nov 2004
Location: The Netherlands
Posts: 573
I agree with the first assesment that tables can and should be used to display data.....now for the second question: you float the video boxes and clear the float after 4 boxes.....
__________________
Available for: CSS | XHTML | PHP | MySQL | Webdesign

webboy21 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2010, 04:41 PM   #5
potter
Confirmed User
 
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
Quote:
Originally Posted by Jakez View Post
Code:
<div class="yourcontainerdiv">

  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>
  <div style="width:XXX;height:XXX;float:left;"></div>

</div>
Why won't that work?
__________________

potter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2010, 04:42 PM   #6
potter
Confirmed User
 
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
Quote:
Originally Posted by Jakez View Post
What kind of structure do you use to place 4 in each row? Does it just push them into a new row because 4 of them reaches the exact width of the container?
Yes. 5678
__________________

potter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2010, 05:11 PM   #7
Babaganoosh
♥♥♥ Likes Hugs ♥♥♥
 
Babaganoosh's Avatar
 
Industry Role:
Join Date: Nov 2001
Location: /home
Posts: 15,841
That's a job for tables. Tables are for containing data, CSS is for layouts. Generating tables on the fly is easy.
Babaganoosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-20-2010, 05:35 PM   #8
react
Confirmed User
 
Industry Role:
Join Date: Sep 2003
Location: NZ
Posts: 673
Tabular data, tables. Done/done.
__________________
--
react
react is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2010, 12:17 AM   #9
harvey
Confirmed User
 
harvey's Avatar
 
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
Quote:
Originally Posted by Jakez View Post
Let's say you want to GENERATE the following type of structure from 12 rows of MySQL data using PHP and a horizontal columns number that can be changed by the webmaster (set to 4 here):



CSS
1: As far as I know, you'd need to know the exact px width of the 'container' and then divide that by the amount of box's (columns) that are set, as well as subtracting paddings, borders, etc., which sounds really messy IMO. Uh oh, what if the person set it to 5 instead of 4? Do a bunch of math in PHP to figure out the new correct width? But then how do you set the 'container' width in your .css file to match the new width?

2: Don't use a 'container' and just spit out 12 <div>'s one after another, use PHP to put a <br> after every 4 columns, or 5, whatever is set? But you have to eventually place this into some kind of 'container' in your layout which is going to have a set width. Fuck.

Tables
1: First lay down <table><tr>, then loop through the 12 rows of MySQL data placing </tr><tr> after every 4 or 5, then put </tr></table> after all that is done. Except if you check the source of the page you will have an empty <tr></tr> at the end.

And then both of these become a LOT more confusing when you try to implement a template system. How do you know whether to use <br> or </tr><tr> since you don't know whether the persons page is created with CSS or Tables?
you're giving the answer yourself. Even though tables are meant for tabular data, if you need flexibility, CSS is the way to go. It's not a coincidence any serious developer is using CSS for almost anything. Even tabular data. Just modify 1 number or variable and you can have more columns. Or rows. Or whatever.

Plus, something many people seems to ignore is that YOU CAN HAVE TABLES WITH CSS. Just use display:table (or display:table-cell, or table-row, or table-column or whatever). Thus, you can have tables and all the power of CSS at the same time. Or you can use table-layout property (although in IE8 you'll need to set auto or fixed, not inherit, which I never use, so what do I care)

Seriously, there's not even an argument here
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth
harvey is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2010, 01:25 AM   #10
AlCapone
Confirmed User
 
AlCapone's Avatar
 
Join Date: Sep 2003
Posts: 708
CSS:
Code:
ul {
	margin:0px;
	padding:0px;
	list-style:none;
	width: 410px;
	height: 410px;
}
ul>li {
	width: 100px;
	height: 100px;
	text-indent: 0px;
	float:left;
}
.c1 {border-right: 2px solid black; border-left: 2px solid black; border-top: 2px solid black;}
.c2 {border-right: 2px solid black; border-top: 2px solid black;}
.c3 {border-bottom: 2px solid black;}
MARKUP:
Code:
<ul>

	<li class="c1"></li>
	<li class="c2"></li>
	<li class="c2"></li>
	<li class="c2"></li>

	<li class="c1"></li>
	<li class="c2"></li>
	<li class="c2"></li>
	<li class="c2"></li>

	<li class="c1"></li>
	<li class="c2"></li>
	<li class="c2"></li>
	<li class="c2"></li>

	<li class="c1 c3"></li>
	<li class="c2 c3"></li>
	<li class="c2 c3"></li>
	<li class="c2 c3"></li>

</ul>
__________________
"You can get more with a kind word and a gun than you can with a kind word alone.”
AlCapone is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2010, 04:11 PM   #11
Jakez
Confirmed User
 
Jakez's Avatar
 
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
Another big problem I have with css is image paths.

Let's say you have this:
Quote:
#header {
background-image:url("bg.jpg");
}
No problem there, unless you have your .css file in a folder such as /css/. So you change it to this:
Quote:
#header {
background-image:url("/bg.jpg");
}
That will jump out of the /css/ folder and back into the main folder where the image is. But if your site isn't in the home directory (site.com/) because you're using a sub domain or something then this isn't going to work. So you specify the path:
Quote:
#header {
background-image:url("/subdir/bg.jpg");
}
OR
Quote:
#header {
background-image:url("http://www.site.com/subdir/bg.jpg");
}
It works again. But this dangerous because if you ever wanted to move the site or copy this layout for use on another site (such as is done in a script) you would have to go through the .css file and replace all kinds of paths! Unacceptable.

This is one of the areas I think the whole CSS layout thing fails, if the layout were done in Tables then you could easily have the sites URL placed into a PHP variable and then when you move the site you simply change this variable and all of the images will still work.

Example:
Quote:
<?php
$site_url = "http://www.site.com/subdir";
?>
<table>
<tr>
<td style="background-image:url(<?=$site_url?>/bg.jpg);">blah</td>
</tr>
</table>
__________________
[email protected] - jakezdumb - 573689400

Killuminati
Jakez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2010, 04:28 PM   #12
fatfoo
ICQ:649699063
 
Industry Role:
Join Date: Mar 2003
Posts: 27,763


Would you like to buy a vowel?
__________________
Send me an email: [email protected]
fatfoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2010, 05:43 PM   #13
Jakez
Confirmed User
 
Jakez's Avatar
 
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
Bump for ideas on the image path problem.
__________________
[email protected] - jakezdumb - 573689400

Killuminati
Jakez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2010, 05:50 PM   #14
psili
Confirmed User
 
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
Quote:
Originally Posted by Jakez View Post
Bump for ideas on the image path problem.
Have you tried the following structure

/index.php
/css/styles.css
/img/image.jpg

and in your styles.css, that's referenced in index.php your background would be:

background: url('../img/image.jpg');
__________________
Your post count means nothing.
psili is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2010, 05:57 PM   #15
candyflip
Carpe Visio
 
candyflip's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: New York
Posts: 43,058
It's not even a question. As has been pointing out, tables are for data.
__________________

Spend you some brain.
Email Me
candyflip is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-21-2010, 07:06 PM   #16
Jakez
Confirmed User
 
Jakez's Avatar
 
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
Quote:
Originally Posted by psili View Post
Have you tried the following structure

/index.php
/css/styles.css
/img/image.jpg

and in your styles.css, that's referenced in index.php your background would be:

background: url('../img/image.jpg');
Ah! I tried ./ and it didn't work, I forgot it was ../
__________________
[email protected] - jakezdumb - 573689400

Killuminati
Jakez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.