Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19
  1. #1
    Junior Member
    Join Date
    Mar 2006
    Posts
    23
    Member #
    12937
    Ok, I am trying to redo my site in CSS because I'm sick of spending hours updating ever page of my site. Now lots of people say "Oh CSS is so wonderful, it's easy and I love it!" I do not find it easy at all.
    Here are my questions:
    1. Let's say I have a column on 50 pages that I want to be the same, but I need to change its content. What is the best way to do this without editing 50 pages? Don't say CSS, because I can't put HTML and Javascript in CSS files.
    2. How do you center tables in CSS? Please don't point me to a totorial, I've read a lot of these, and none of them have given me an answer. I want the table to accually be centered, not x pixels from the left or right.
    3. How do you put objects side by side in CSS? I have three tables I want side by side, but they always end up on top of each other. How do I fix this?
    4. What is the best way to convert 250 pages from HTML to CSS without working for 10 hours straight?
    Sorry if I'm a little bit blunt, I've ask a lot of people these questions and never gotten any asks that were useful.

  2.  

  3. #2
    Senior Member Eddy Bones's Avatar
    Join Date
    Jan 2004
    Location
    Washington, USA
    Posts
    1,054
    Member #
    4651
    1) The most plausible solution is to use a PHP include.
    You would use something like below in place of the content to be shown (you'd have to put it on each page, of course), and in the file.ext you would put that content.
    PHP Code:
    <?php include("file.ext"); ?>
    This is assuming you have PHP support.

    2) Define the table's width in CSS, and then use margin: 0px auto;
    I believe this will work, though I may be mistaken. I haven't used CSS on tables very much.

    3) Tables automatically create a line break, so I think you'd have to use clear: none; on them. Again, I'm not completely sure of this solution, but it's worth a try.

    4) I don't think you have much of a choice, unless you can use some sort of find and replace function in Dreamweaver or some other program. Would beat scanning the code and replacing stuff by hand. But you're bound to have to do a lot of work to fix it.

  4. #3
    Junior Member
    Join Date
    Mar 2006
    Posts
    23
    Member #
    12937
    Thanks for the help.
    I do have Dreamweaver, so if you know of a repet fuction that would be very helpful.
    Is it possible to use PHP tags on a page that doesn't end in .php?

  5. #4
    Junior Member
    Join Date
    Mar 2006
    Posts
    23
    Member #
    12937
    Darn, the php tag didn't work...the table came up blank.

  6. #5
    Senior Member audiofreak9's Avatar
    Join Date
    Apr 2005
    Location
    NJ
    Posts
    339
    Member #
    9584
    1. Make the column a <div> instead of a table or table cell. Assign each of those 50 column (divs) the same class on each page they appear, changing only the content for each page, not the class. They will have the same look/feel but different content. Fortunately if you make one CSS change ALL of the 50 columns look/feel will change on each page.

    2. Wrap the table(s) in one <div> that has the CSS code: margin: 0px auto;

    3. [deleted]I believe assigning the table(s) a class that includes the CSS: display: inline would work.[/deleted] Or wrap each in a <div> and assign each <div> the following CSS: float: left;. Don't forget you will nead a clearing <div> for the floats: clear: both;

    4. Make a finalized template that will be for all the 250 pages. Then just copy/paste the content into the template's HTML, saving each under the correct page name. YES it will suck!:ermm: Includes would make this most easy as Eddy stated . Typically the header, navigation, and footer don't change, allowing you to just write them once and globally include them.

    I'm sure you have heard this before, try to avoid tables, using <div> and <span> instead.

  7. #6
    Senior Member karinne's Avatar
    Join Date
    Dec 2003
    Location
    Aylmer QC Canada
    Posts
    1,607
    Member #
    4335
    Liked
    8 times
    1- If you're not going to be using PHP in your site I suggest Server-Side Includes (SSI).

    - Rename your pages to have the .shtml extension instead of .html .

    - The portion you want to include in all your files, put it in a separate file and call it whatever.inc (it can be .html or .ssi - extension doesn't matter here)

    - In your file you want to include this whatever file you put

    Code:
    <!--#include file = "whatever.inc" -->
    That's it ... you're done.

    There's more info in a tutorial on this site - http://www.webdesignforums.net/showthread.php?t=8445 -
    [a web design portfolio - Currently NOT AVAILABLE for work | web design | Re-coding | PSD-to-HTML]
    I'm also on: virb - facebook - twitter - flickr - del.icio.us

  8. #7
    Junior Member
    Join Date
    Mar 2006
    Posts
    23
    Member #
    12937
    Ok, how to I use these tags? They don't work. I put in all the right stuff and rename the files and upload it. When I go to my site, it just says "error processing command" in the spot where the content should have been.
    What is wrong? Also, is there any way to use these tags without changing the name of ever single page? That also includes all the links, and it would take hours. I've seen sites that use php tags on pages ending in .html, how do they do this?
    I have a javascript/CSS menu on my site, and it uses JavaScript tags to put the menu on ever page. All I have to do it update one file and the whole site updates. Is there any way I could use Javascript tags to update multiple pages at once?

  9. #8
    Junior Member
    Join Date
    Mar 2006
    Posts
    23
    Member #
    12937
    Quote Originally Posted by audiofreak9
    2. Wrap the table(s) in one <div> that has the CSS code: margin: 0px auto;
    setting the margin: 0px auto only puts the columns on the far left part of the page, and I don't know if it's possible to put all the tables in one <div>

  10. #9
    Senior Member audiofreak9's Avatar
    Join Date
    Apr 2005
    Location
    NJ
    Posts
    339
    Member #
    9584
    Quote Originally Posted by stargate3216
    setting the margin: 0px auto only puts the columns on the far left part of the page, and I don't know if it's possible to put all the tables in one <div>
    Sure it is, it's like the <body> tag wraps the body of the webpage. Place it before the table(s) start, and at the end of the table(s), wrapping the table(s).

  11. #10
    Junior Member
    Join Date
    Mar 2006
    Posts
    23
    Member #
    12937
    But then how do I specipy tables? Most of the time its like
    <div id=header>dfjsdlkjfnasd;lkfa</div>
    <div id=body>sfasdfasdfasdf</div>


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:55 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com