jimfog 30 Posted April 27, 2011 Report Share Posted April 27, 2011 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. Quote Link to post Share on other sites
rubykitten 0 Posted April 27, 2011 Report Share Posted April 27, 2011 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. Quote Link to post Share on other sites
cousineaug 0 Posted April 27, 2011 Report Share Posted April 27, 2011 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 Quote Link to post Share on other sites
jimfog 30 Posted April 28, 2011 Author Report Share Posted April 28, 2011 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. Quote Link to post Share on other sites
cousineaug 0 Posted April 28, 2011 Report Share Posted April 28, 2011 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 :-) Quote Link to post Share on other sites
jimfog 30 Posted April 28, 2011 Author Report Share Posted April 28, 2011 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.