HTML Tables?

2008-06-24 3:57 pm
Hey I am having trouble with this table within a table. Im trying to make this one table appear "center, top" but it isnt going to the top, but my logo is. Here is the code...

<table bgcolor="#FFFFFF" width="800px" height="430" cellpadding="5" cellspacing="0" border="0">

<!-- <tr>
<td align="right" valign="top">
<td align="left" valign="top">
</td>
</tr>
-->
<tr>
<td valign="top" align="right">
<a href="index.php"><img src="Logo.jpeg" border="0"></a>
</tr>
<?
if(isUserLoggedIn()){
generateLoggedMenu();
} else {
generateNullMenu();
}
?>

</td>


<td align="center" valign="top"><!--this changes the table inside the box"-->

Anybody help me out?

回答 (2)

2008-06-24 4:16 pm
✔ 最佳答案
there's a few things that immediately pop out to me

first...none of the stuff inside the comment tags will ever be interpreted, and even if it was you have the <td> tags wrong

second...you close your table row before completing the data tag in the uncommented part.

third...you really should look into using css instead of tables for formatting a page. Tables should be reserved for formatting data, not content.

http://www.w3schools.com/css/
2008-06-24 4:49 pm
First of all, your tags don't match.

Try coding the <tr> and <td> first.

<tr>
<td></td>
<td></td>
</tr>

<tr>
<td></td>
<td></td>
</tr>

Then put in the content.

For your second <tr> row, are you merging two <td>s into one? If yes, your <td> should be <td colspan="2">

Finally, the last <td> in your codes, is it supposed to be part of the second row? If yes, put it back before the second </tr>. If no, then start a new <tr> for it.


收錄日期: 2021-05-03 14:03:34
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080624075749AAWtlKv

檢視 Wayback Machine 備份