![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
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? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
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) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
Quote:
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? |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
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.....
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
|
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>
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
|
Yes. 5678
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
♥♥♥ Likes Hugs ♥♥♥
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.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Industry Role:
Join Date: Sep 2003
Location: NZ
Posts: 673
|
Tabular data, tables. Done/done.
__________________
-- react |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
|
Quote:
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 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
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;} 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.” |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |||||
Confirmed User
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:
Quote:
Quote:
Quote:
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:
|
|||||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
ICQ:649699063
Industry Role:
Join Date: Mar 2003
Posts: 27,763
|
![]() Would you like to buy a vowel?
__________________
Send me an email: [email protected] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
Bump for ideas on the image path problem.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
|
Ah! I tried ./ and it didn't work, I forgot it was ../
|
![]() |
![]() ![]() ![]() ![]() ![]() |