Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > div, align and css

Reply
Thread Tools

div, align and css

 
 
skibud2
Guest
Posts: n/a
 
      08-09-2007
Hi All,

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

This aligns the table to the right of the div
<div align = "right">
<table> ..</table>
</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

 
Reply With Quote
 
 
 
 
Ben C
Guest
Posts: n/a
 
      08-09-2007
On 2007-08-09, skibud2 <(E-Mail Removed)> wrote:
> Hi All,
>
> How can I do the equivalent to the following in CSS.
>
> This aligns the table to the right of the div
><div align = "right">
> <table> ..</table>
></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.
 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      08-09-2007
On Aug 9, 5:23 pm, skibud2 <(E-Mail Removed)> wrote:
> Hi All,
>
> How can I do the equivalent to the following in CSS.
>
> This aligns the table to the right of the div
> <div align = "right">
> <table> ..</table>
> </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/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
<div align=center> also affects align of dynamic dropdown item text Steve Richter ASP .Net 1 06-24-2007 07:11 PM
left align within centre align Paul Lautman HTML 3 03-03-2006 02:45 PM
text-align vs align tshad HTML 1 06-23-2005 10:29 PM
CSS and the dead "align" attribute Andrew Cameron HTML 18 09-11-2003 11:06 PM
how to Align text left & vertical align middle Kay ASP .Net 2 07-25-2003 08:32 AM



Advertisments