Jump to content

position of text in table not at top of tables


jasonc

Recommended Posts

i am having trouble getting the text in the two center boxes positioned to the top.

 

i have provided two versions of this table to show i have tried to use the valign and CSS but both seem not to work.

 

how do i correctly get the text indicated in my code to be at the top of these TD's

 

why also does some work and position correctly but the other two dont ?

 

i know that using tables is not a good idea and a lot of these tags are said to be not valid but they still work !

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<head>
<style type="text/css">
<!--
td {vertical-align: top;}
-->
</style>
</head>
<body>








<table width="1100">
  <tr> 
    <td width="296" rowspan="2" valign="top"> 
          <div align="justify"><font color="#FFFFFF" size="2" face="Tahoma">text</font></div>
          </td>
    <td width="195" rowspan="2" align="center" valign="top"> 
      <div><a href="?i=6" target="_top"><font color="#FFFFFF" size="2" face="Tahoma">text</font></a></div>

            <br> 
          </td>
    <td colspan="2" align="right" valign="top"> <img border="0" align="top" width="450"></td>
    <td width="196" rowspan="2" valign="top"><a href="?c=ad" target="_blank"><font color="#0066FF">site</font></a><br><br>
      <acronym title=""><img width="120">	
      </acronym><br>
      <br>
      <img width="120"><br>
      <br><a href="?ac=ad" target="_blank"><font color="#0066FF">site</font></a></td>
  <tr> 
    <td align="center" valign="top"><a href="?c=sub" target="_top"><font color="#FFFFFF" size="2" face="Tahoma">this should be at the top of this box</font></a></td>

    <td align="right" valign="top"> 
    <div align="center"><a href="" target="_top"><font color="#FFFFFF" size="2" face="Tahoma">this should be at the top of this box</font></a></div>
    </td>
  </tr>
</table>







<table width="100%">
  <tr> 
    <td width="29%" rowspan="2" valign="top"> 
      <div align="justify"><font color="#FFFFFF" size="2" face="Tahoma">text</font></div></td>

    <td width="17%" rowspan="2" align="center" valign="top">
	<div><a href="?c=6" target="_top"><font color="#FFFFFF" size="2" face="Tahoma">text</font></a></div>
    </td>
    <td colspan="2" align="right" valign="top"> <img border="0" align="top" width="450"> 
    </td>
    <td width="17%" rowspan="2" valign="top">

<a href="?c=ad" target="_blank"><font color="#0066FF">site</font></a><br><br>
      <acronym title=""><img width="120">	
      </acronym><br>
      <br>
      <img width="120"><br>
      <br><a href="?c=ad" target="_blank"><font color="#0066FF">text</font></a></td>
  </tr>
  <tr> 
    <td width="20%" align="center" class="tdtop"><a href="?c=sub" target="_top"><font color="#FFFFFF" size="2" face="Tahoma">this should be at the top of this box</font></a></td>
    <td width="17%" align="center">
    <a href="" target="_top"><font color="#FFFFFF" size="2" face="Tahoma">this should be at the top of this box</font></a>
</td>
  </tr>
</table>




</body>
</html>

Link to comment
Share on other sites

As you noted, building a site with a table design is a big no-no. Here's a tutorial about it: CSS layouts. I would sincerely suggest you redo the layout you have into CSS style. It may be a pain to redo, but in the long run, it's much more clean, elegant and easy to fix.

 

Also, your question "Why do some of them work" is kinda ambiguous: what do you mean they position correctly and other's don't? Which do and which don't?

Link to comment
Share on other sites

the td's that are in their own columns show ok and have the text show at the top

 

corrected code

 

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<table width="100%">
  <tr>
    <td width="29%" rowspan="2" valign="top">
      <div align="justify"><font size="2" face="Tahoma">ok</font></div></td>

    <td width="17%" rowspan="2" align="center" valign="top">
      <div><a href="?c=6" target="_top"><font size="2" face="Tahoma">ok</font></a></div>
    </td>
    <td colspan="2" align="right" valign="top">ok <img border="0" align="top" height="10" width="450"> 
    </td>
    <td width="17%" rowspan="2" valign="top"> <a href="?c=ad" target="_blank">ok</a><br> 
      <br>
      <img height="100" width="120"></td>
  </tr>
  <tr>
    <td width="20%" align="center" class="tdtop"><a href="?c=sub" target="_top"><font size="2" face="Tahoma">this 
      should be at the top of this box</font></a></td>
    <td width="17%" align="center"> <a href="" target="_top"><font size="2" face="Tahoma">this 
      should be at the top of this box</font></a> </td>
  </tr>
</table>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.