Jump to content

style property/td element


jimfog

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.

Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
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 :-)
Link to comment
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.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...