SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
-
Jun 26, 2001, 10:24 #1
- Join Date
- Jan 2001
- Location
- Ottawa ON
- Posts
- 315
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Please Provide a Simple Answer: What is the CSS equivalent of <table align="center">
Please Provide a Simple Answer: I'm wondering what the CSS equivalent of <table align="center"> is. I searched Google for this and came upon this discussion which didn't seem to arrive at a clear answer:
http://lists.w3.org/Archives/Public/...7Oct/0064.html
Four years later I'm sure that there is somethign very simple, but I don't knwo what it is.
<table align="center">
<table style="?????:center">
-
Jun 26, 2001, 10:28 #2
-
Jun 26, 2001, 10:37 #3
- Join Date
- Jan 2001
- Location
- Ottawa ON
- Posts
- 315
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Text-align doesn't seem to work - it centers text inside of the table and that's not what I want.
<table align="center"> makes the table itself centerd and doesn't affect the positioning of the text inside of that table.
<table style="text-align:center"> doesn't center the table (which I tried it the table was in its default position - left aligned) and the text inside of the table was centered.
What I want to do - center the table, but not the text. This is what <table align="center"> does. What is the CSS equivalent?
-
Jun 26, 2001, 10:48 #4
- Join Date
- Oct 2000
- Location
- Austin, TX
- Posts
- 1,438
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ah right, margin-left: auto; margin-right: auto; is what you need.
-
Jun 26, 2001, 10:57 #5
- Join Date
- Jan 2001
- Location
- Ottawa ON
- Posts
- 315
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by Anarchos
Ah right, margin-left: auto; margin-right: auto; is what you need.
I'll start using that, but I consider center something basic and I think that's a bizarre design decision on the part of the W3C. There are a lot of elements in CSS that you can explicitly center, text for one. why should tables be the exception?Last edited by prowsej; Jun 26, 2001 at 11:03.
-
Jul 12, 2001, 03:55 #6
- Join Date
- Jun 2001
- Location
- New Zealand
- Posts
- 34
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I think what your trying to do is:
<style type="text/css">
<!--
table.class{align:center;}
-->
</style>
-
Jul 12, 2001, 06:52 #7
- Join Date
- Oct 2000
- Location
- Nashvegas Baby!
- Posts
- 7,845
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Technically, you should be putting any content that needs centering inside a DIV tag and centering the DIV itself.
Adobe Certified Coldfusion MX 7 Developer
Adobe Certified Advanced Coldfusion MX Developer
My Blog (new) | My Family | My Freelance | My Recipes
-
Jul 12, 2001, 07:40 #8
- Join Date
- Mar 2001
- Location
- Madison, Wisconsin
- Posts
- 42
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here are a couple of links that deal with centering block level elements using CSS.
http://bluerobot.com/web/css/center1.html
http://bluerobot.com/web/css/center2.html
bluerobot.com also has some very nice layouts that you can look at and view the stylesheets.
Bookmarks