div, align and css

div, align and css

am 09.08.2007 18:23:42 von skibud2

Hi All,

How can I do the equivalent to the following in CSS.

This aligns the table to the right of the div


..




The CSS style:
..right {text-align: right;}
does not work for non text. Am I stuck with putting the align
attribute directly in? I don't want to use float because this div is
within a table.

Thanks in advance,

Mike

Re: div, align and css

am 09.08.2007 18:46:54 von Ben C

On 2007-08-09, skibud2 wrote:
> Hi All,
>
> How can I do the equivalent to the following in CSS.
>
> This aligns the table to the right of the div
>


> ..

>

>
>
> The CSS style:
> .right {text-align: right;}
> does not work for non text.

No, and there is no standard CSS property that does. Well actually,
that's not quite true, you _could_ use "direction: rtl" on the div,
which will cause the table to go to the right. But I wouldn't advise
using that unless the text is actually in Arabic or another rtl
language. It could well have undesired side-effects.

> Am I stuck with putting the align attribute directly in? I don't want
> to use float because this div is within a table.

So what? You can float things inside table cells, that's no problem.
Best to float: right the table, that's the CSS way to do this.

Re: div, align and css

am 09.08.2007 19:53:28 von dorward

On Aug 9, 5:23 pm, skibud2 wrote:
> Hi All,
>
> How can I do the equivalent to the following in CSS.
>
> This aligns the table to the right of the div
>


> ..

>


table {
margin-left: auto;
margin-right: 0;
}

Make sure you use a Doctype that triggers standards mode in IE.

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/