2
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by almostbob
0

post the code,
including the css
that you are using

we dont do homework, nobody is going to look it up, fix it, and post it for you
but we do show the bugs in what you have tried

Edited by almostbob: n/a

0

almostbob,

The link I posted was my code. Here it is directly on the forum:

index.html

<html>
<head>
<link href="table.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>

<table>
        <!--headers-->
        <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        </tr>

        <!--First row-->
        <tr>
        <td>Peter</td>
        <td>Griffin</td>
        </tr>

        <!--Second row-->
        <tr>
        <td>Lois</td>
        <td>Griffin</td>
        </tr>
</table>

</body>
</html>

table.css

/* th = table header, td = table data */

table
{
width:100%;
}

th
{
height:50px;
text-align:center;
}

td
{
height:50px;
text-align:center;
}

~Dave

1

with no dtd you are limited to html2
self closed elements (end in /> ) are xhtml ONLY
the declaration of your css wil lbe ignored

if you make the firstline of the html file a dtd for html 4 (strict or transitional) or xhtml (strict or transitional) you will be able to properly use external css files <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> sample html4 Transitional DTD
course notes are never complete

Edited by almostbob: n/a

Votes + Comments
Thanks almostbob
0
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html>
<head>
<link href="table.css" rel="stylesheet" type="text/css" media="screen" >
</head>
<body>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Peter</td>
<td>Griffin</td>
</tr>
<tr>
<td>Lois</td>
<td>Griffin</td>
</tr>
</table>
</body>
</html>

should function
whitespace and indenting are not required for production code and should be removed
often 40-50% of the filesize downloaded to the user browser is whitespace
Its ok as an aid to developer, but a code highlighting notepad is better.

Edited by almostbob: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.