Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2008
    Thanked 0 Times in 0 Posts

    I cant make a table cascade to page

    Im tring to make a cascading style sheet and cant get it to work with tables , I can get other styles to work but when I make a tabl on the page ity wont cascade to the next page Im tring to keep it simple to understand it. the code below is an example if I save it as a "main.css" then save another page
    as a .html and add <link ref="stylesheet" type="text/css" href="main.css"> to the head section of the .html. everything seems to work then if I change lets say the table size on the "main.css" page it doesnt change on the copied .html

    I just cant figure it out Ive been able to make this work with simple colors and fonts and it works. Basically I am tring to cascade an entire page so if i decide to change the look i can by changing one page is the a code I can place that makes this possible. I hope this make scence If not I understand Its confusing me and I wrote it...lol thanks for any help

    <style type="text/css">
    table-layout: automatic

    <table class="one" border="1" width="100%">
    <TD> one</TD>
    <TD> two </TD>
    <TD> three </TD>
    <TD> four </TD>

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Thanked 1,847 Times in 1,831 Posts
    Hello bostonryan,
    It sounds like your trying to save your table as a .css file and then link to it in an .hmtl file. That's not going to work.

    -The code you quote there is not a css file. Save it as .html.
    -Make an empty file called main.css (your using notepad, right?) and put the following in it:
    body {
    background: #ccc;
    -link to your main.css inside the head of all your html files. It looks like the link you posted will work fine as long as the path points to where you put main.css

    Now the html documents that are linked to main.css will have a #ccc (gray) background.
    Last edited by Excavator; 11-26-2008 at 03:12 AM.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts