Jump to content
jimfog

style property/td element

Recommended Posts

I am trying to apply the following style property to a td element:

<td style=" position:relative; bottom:20px;"  > <a href="xxxxxxxxxxxx">xxxxxxxxxxxx</a></td>  </tr>

and it does not work.I am trying to do the above with inline css(the code is not placed in a separate css file) allthough there is one in the site i am constructing.The whole table code( HTML)is the following:

<table  id="commun"   cellspacing="19" width="200" border="0">  <tr>	<td>xxxxxxxxxxxxxxx</td>  </tr>  <tr>	<td style=" position:relative; bottom:20px;"  > <a href="xxxxxxxxxxxxxxxxx">xxxxxxxxxxxxxxxx</a></td>  </tr></table>

The css for the table:

#commun { position:relative;top:85px;z-index:1;right:12px;font-weight:bold;}

I hope i am giving enough information.The reason i want position this td element is to have it aligned with the background image which is placed behind the table.

Share this post


Link to post
Share on other sites

The reason you are having issues with this is that the style position:relative; does not work with td items. Table items are very fixed in there position, however you can use padding to pad the items within a td if you wish.For what you are looking to do however, you should consider using a div tag and not a table.

Share this post


Link to post
Share on other sites
I am trying to apply the following style property to a td element:
<td style=" position:relative; bottom:20px;"  > <a href="xxxxxxxxxxxx">xxxxxxxxxxxx</a></td>  </tr>

I also suppose it is the text you are trying to align bottom and not the TD
<td> <div style=" position:relative; bottom:20px;" ><a href="xxxxxxxxxxxx">xxxxxxxxxxxx</a></div></td>  </tr>

Guy

Share this post


Link to post
Share on other sites

I did my job with div elements instead.It was a mistake from the beginning to mess with tables.And i did not know that position:relative does not apply to td elements.

Share this post


Link to post
Share on other sites
I did my job with div elements instead.It was a mistake from the beginning to mess with tables.And i did not know that position:relative does not apply to td elements.
good JobStay away from tables. UNLESS you really have tabular data like a chart, spreadsheet etc.Guy :-)

Share this post


Link to post
Share on other sites
good JobStay away from tables. UNLESS you really have tabular data like a chart, spreadsheet etc.Guy :-)
I assume how difficult it must have been for developers in the past to maintain a site built in tables.It is a nightmare.I have never realized-tiil now- how difficult is to maintain a site with tables.Thanks for the help.

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...

×
×
  • Create New...