473,503 Members | 4,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Centering a Table

replace Q with c Mike Copeland wrote:
I have a simple (?) page that has only a table as its content (I
suppose I could do it some other way, but I'm unsure of how...). I want
the table to be centered on the page. It works with I.E., but fails
with other browsers (FF, SeaMonkey, etc.): it aligns on the left part of
the page.
Apart from of the annoying differences with I.E. and other browsers,
what can I do to assure the table's data is centered on the rendered
page? TIA
http://mrcccs.890m.com/RHContact.html
Tables are block elements, you center blocks of smaller width within
other blocks by setting the left and right margins to "auto". You do not
use "text-align: center" that is for alignment of inline text....

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

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jun 27 '08 #1
1 1417
replace Q with c Mike Copeland wrote:
I have a simple (?) page that has only a table as its content (I
suppose I could do it some other way, but I'm unsure of how...). I want
the table to be centered on the page. It works with I.E., but fails
with other browsers (FF, SeaMonkey, etc.): it aligns on the left part of
the page.
Apart from of the annoying differences with I.E. and other browsers,
what can I do to assure the table's data is centered on the rendered
page? TIA
http://mrcccs.890m.com/RHContact.html

Tables are block elements, you center blocks of smaller width within
other blocks by setting the left and right margins to "auto". You do not
use "text-align: center" that is for alignment of inline text....

table { margin-left: auto; margin-right: auto; }
I tried that, but it doesn't change any of the rendering behavior:
I.E. works, but other browsers don't.
I also removed the "text-align: center", but that made I.E. fail,
too.
It seems I didn't understand your message: could you show what code
is to be changed and where to implement the changes? TIA
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
5715
by: George Ziniewicz | last post by:
.. I try to use CSS when possible, though I am still learning and don't maximize its use. In particular, I still use a table to provide for a centered image in a few slideshows (though table...
1
7884
by: Kenneth | last post by:
Okay, I've been scouring Google for hours looking for a solution to this problem, but as of yet I can't find one. XHTML Transitional seems to specify that I can no longer set a table's height to...
3
6103
by: yawnmoth | last post by:
I'm trying to center list elements in a webpage I'm working on, and setting margin-left to auto for ol (or ul) seems to prevent the number (or bullet) from displaying in IE6 (strict mode) and...
1
1823
by: Arnost Sobota | last post by:
Hello, I am aware that the correct way to center a block-level element is to set the left and right margins to auto. However, this seems to only if the element to be centered has a width...
3
4189
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a...
5
4808
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up...
2
3023
by: rudicheow | last post by:
SHORT VERSION ============= I have a bunch of identical fixed-size single-celled tables that rest against each other horizontally thanks to "float:left". These tables are dynamically generated...
9
7243
by: Neal | last post by:
http://www.brassattackofspringfield.com/gigs.html CSS at http://www.brassattackofspringfield.com/default.css Opera and IE render caption as desired. Firefox does not. Why? And is there a fix?
7
6570
by: SpaceMarine | last post by:
hello, i see that <table align="center"is no longer valid markup in XHTML. nor is <center><table></table></center>. how then does one center a table? found articles for centering text: ...
1
2271
by: =?Utf-8?B?ZnJhbmt5?= | last post by:
Hello, I've created a table that has two rows that are span across three columns. The third row has three columns, each with an image. The last row is also span accross three columns. The span...
0
7193
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4992
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.