Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Double justify text and an image in a table cell

Status
Not open for further replies.

gavin34

Programmer
Nov 1, 2007
4
0
0
IE
I want to align the contents of a column cell in a table so that the text is on the left and the image is on the right. The HTML snippet I have currently, which does not work is:

<td align="justify">
<a href="addsystems.php">Add Sys</a>
<img src="../img/folder.gif" width="20" height="20" />
</td>

I thought about creating a new column cell to hold the icon, which would get around this problem.e.g.

<td align="left">
<a href="addsystems.php">Add Sys</a>
</td>
<td align="right">
<img src="../img/folder.gif" width="20" height="20" />
</td>

But was wondering if it is possible to do in just one column cell.

Any suggestions as to how to achieve this much appreciated.

Gavin
 
HTML:
<td class="justify">
<a href="blah.html">Blah</a>
<img src="blah.jpg" alt="blah" />
</td>

CSS:
td.justify a { float:left; }
td.justify img { float:right; }

If all your cells are to have content justified like this then you can omit the class (or perhaps apply it to the table instead).

--
Tek-Tips Forums is Member Supported. Click Here to donate

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.


 
Thanks Foamcow

That worked exactly the way I wanted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top