472,990 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,990 software developers and data experts.

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 1404
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
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
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
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
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
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
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
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
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
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
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
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.