dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Please help me!

  1. #1
    Join Date
    Apr 2003
    Location
    North Yorkshire
    Posts
    16

    Please help me!

    im new to css and was wondering how you use style sheets with tables?
    if anyone can help i would be very grateful!
    thanks

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Example</title>
    <style type="text/css">
    <!--
    table {
    background-color:#900;
    margin:auto;
    }
    th, td {
    background-color:#aaa;
    font-weight:normal;
    padding:0.5ex;
    text-align:center;
    vertical-align:top;
    }
    th {font-style:italic}
    -->
    </style>
    <table summary="A table showing...">
    <tr>
    <th>Heading</th>
    <th>Heading</th>
    <th>Heading</th>
    <th>Heading</th>
    </tr>
    <tr>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    </tr>
    <tr>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    </tr>
    <tr>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    </tr>
    </table>
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Apr 2003
    Location
    North Yorkshire
    Posts
    16
    ok thanks but would you mind giving me the specific code for making the font family different? and having the table aligned in the center of the page?also, i have a caption on the table. is there a way of making the css include the caption?
    Last edited by valhala_90; 06-17-2003 at 07:54 AM.

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Example</title>
    <style type="text/css">
    <!--
    table {
    background-color:#900;
    margin:auto;
    }
    th, td {
    background-color:#aaa;
    font-weight:normal;
    padding:0.5ex;
    text-align:center;
    vertical-align:top;
    }
    th {font-style:italic}

    caption, th {font-family:Verdana, sans-serif}

    td {font-family:Georgia, serif}
    -->
    </style>
    <table summary="A table showing...">
    <caption>Exmple</caption>
    <tr>
    <th>Heading</th>
    <th>Heading</th>
    <th>Heading</th>
    <th>Heading</th>
    </tr>
    <tr>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    </tr>
    <tr>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    </tr>
    <tr>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    <td>Data</td>
    </tr>
    </table>
    <p><a href="http://validator.w3.org/check/referer"><img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" height="31" width="88"></a></p>
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles