Page 1 of 1

image on right

Posted: Sat Nov 20, 2004 1:06 pm
by mudkicker
Hey people,
I have a little problem with css.
i have a table like this:

Code: Select all

<table width="100%"  border="0" cellspacing="0" cellpadding="0" id="block"> 
					<tr> 
						<th scope="col"><img src="ui/dot.gif" alt="" />module name<img src="ui/arr.gif" alt="" width="10" height="9" /></th> 
					</tr> 
					<tr> 
						<td>module info</td> 
					</tr> 
				</table>
arr.gif should be near the right border even everything is aligned to left.
How can i set this?

These are the css properties for this table:

Code: Select all

#block &#123;
	background-color: #DECDBC;
	border: 1px solid #95612F;
	height: auto;
	text-align: left;
	width: 100%;
&#125;

#block img &#123;
	margin-right: 5px;
&#125;

#block td &#123;
	padding-left: 3px;
&#125;

#block th &#123;
	background-color: #95612F;
	color: #E0D1C3;
	font-size: 1.0em;
	font-weight: bold;
	padding: 1px 1px 2px 3px;
	vertical-align: middle;
&#125;

Posted: Sat Nov 20, 2004 4:19 pm
by djot
-
Hi,

You can't. How would you devide content within only ONE table cell to be aligned left AND right at the same time?
This is not logic and therefor impossible this way.
To have two cells in the header row would have been the easiest way.

djot
-

Posted: Sat Nov 20, 2004 4:33 pm
by MarK (CZ)
Why not just 'align="right"' for IMG? Or 'style="float: right;"'.

Posted: Sat Nov 20, 2004 4:39 pm
by djot
-
Hi,

you are right MarK, this does work.

Code: Select all

style="float: right;"

djot
-

Posted: Sun Nov 21, 2004 5:31 am
by mudkicker
it doesn't work for me, image goes one row under.

Posted: Sun Nov 21, 2004 5:58 am
by MarK (CZ)
Try putting it like this:

Code: Select all

<th scope="col"><img src="ui/dot.gif" alt="" style="float: left;" /><img src="ui/arr.gif" alt="" style="float: right;" width="10" height="9" />module name</th>

Posted: Sun Nov 21, 2004 6:18 am
by mudkicker
ok let me try it.

Posted: Sun Nov 21, 2004 6:30 am
by mudkicker
ok but now thay are not aligned veritcally.. they stay too high for text.

you can look at it:

http://mudkicker.no-ip.com/mud_new/index.htm

oh only this solved and i'm free to go! grr... :(

Posted: Sun Nov 21, 2004 8:26 am
by MarK (CZ)
what about this one?

Code: Select all

<TH scope=col><IMG style="float: right;" height=9 alt="" src="mudkicker_com_files/arr.gif" width=10><IMG alt="" src="mudkicker_com_files/dot.gif">module name</TH>
The right one isn't exactly in the middle of the text but it's not that visible.

Posted: Sun Nov 21, 2004 8:32 am
by mudkicker
ok. i did it, i made a margin-top style for it and it's even in the middle. thanks mark

Posted: Sun Nov 21, 2004 8:49 am
by MarK (CZ)
Great :)