Previous Message
Next Message

Re: [css-d] Using CSS to style tabular data?

Sent by Big John on 14 August 2002 05:05


Edwardson Tan wrote:
-snip-
> Speaking of tables how does one center <table> in IE5.5 Win 
> using CSS? table {margin: auto;} has no effect on it. Has 
> this been fixed in IE6?

Using auto margins to center block elements is
inadequate for IE5.x/win. Happily that browser
mis-applies the property'text-align' to all elements,
not just inline ones. So in the body put:

  body {text-align: center}

This centers descendant block elements (like tables) in 
IE5.x. Then in any children of 'body' that may need it, put:

  table {text-align: left} /*resets default*/

By using this and auto margins together, all major
browsers are covered.

> And is there a CSS equivalent of <table cellspacing="0">? 
> Can't get rid of the spacing using td {margin: 0}. I need 
> the cell borders to touch one another.

I believe that's 'border-collapse: collapse;'.

<http://www.w3.org/TR/REC-CSS2/tables.html#borders>

<http://macedition.com/cb/resources/tableCSStest.html>

HTH
Big John

=====
"What the world needs is a good bug ring"--Big John
<http://users.rraz.net/mc_on_the_rocks/testpage/pie.html>

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com
Previous Message
Next Message

Message thread:

Possibly related: