473,394 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Centering tables

My test site: http://www.email48.freeserve.co.uk has two tables on the first
page, try as I might I can't get them to center in Netscape 7- relative to
the size of the screen (rather than absolutely).
Now I know the arguments about not using tables but as I'm just starting out
in css, I want to convert my existing pages rather than re-write the whole
thing.
I've read and re-read loads of sites and can't find a suitable property.
Any help much appreciated

Thanks

Neil
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.502 / Virus Database: 300 - Release Date: 18-07-03
Jul 20 '05 #1
6 2026
Neil Mac wrote:
My test site: http://www.email48.freeserve.co.uk has two tables on the
first page, try as I might I can't get them to center in Netscape 7-


http://david.us-lot.org/www/centre/#block

--
David Dorward http://david.us-lot.org/
Jul 20 '05 #2

"David Dorward" <do*****@yahoo.com> wrote in message
news:bf*******************@news.demon.co.uk...
Neil Mac wrote:
My test site: http://www.email48.freeserve.co.uk has two tables on the
first page, try as I might I can't get them to center in Netscape 7-


http://david.us-lot.org/www/centre/#block

--
David Dorward http://david.us-lot.org/

Fantastic - you've saved me from going hairless.
Definitely a site to bookmark
Thanks

Neil

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.502 / Virus Database: 300 - Release Date: 18-07-03
Jul 20 '05 #3
Stan Brown wrote:
http://david.us-lot.org/www/centre/#block
There is at least one issue not addressed there: All your interior
cells will also be centered.


Quote:
The element then needs to have its own text-align reset to left.

(and see the example).

--
David Dorward http://david.us-lot.org/
Jul 20 '05 #4
David Dorward <do*****@yahoo.com> suggests:
My test site: http://www.email48.freeserve.co.uk
has two tables on the first page, try as I might I
can't get them to center in Netscape 7-
http://david.us-lot.org/www/centre/#block


Neat... except that it doesn't seem to work. I cut and pasted right off
your page, and bagged the "text-align: center" approach in my external
style sheet.

h1, h2, h3, h4, h5 {
margin-left: auto;
margin-right: auto;
}

In every instance, the heads and sub-heads appear flush-left in IE6.0
and Netscape 7.0.

What did I misunderstand?

--
- Yours truly, Pete Collinson
Jul 20 '05 #5
"Peter Collinson" <bl******@optonline.net> skrev :
In every instance, the heads and sub-heads appear flush-left in IE6.0
and Netscape 7.0.

What did I misunderstand?


You must have a width on the element.

h1, h2, h3, h4, h5 {
margin-left: auto;
margin-right: auto;
width: 80%
}
--
Knud
Jul 20 '05 #6
Peter Collinson wrote:
h1, h2, h3, h4, h5 {
margin-left: auto;
margin-right: auto;
}

In every instance, the heads and sub-heads appear flush-left in IE6.0
and Netscape 7.0.


Most likely the element is centred, but is taking up the whole width of the
window, and the text inside the element is aligned to the left (which is
the default).

--
David Dorward http://david.us-lot.org/
Jul 20 '05 #7

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...
3
by: Jonah Bishop | last post by:
I have a puzzling problem with centering text, and I'm hoping that someone here can help me out. First of all, let me state that I am using XHTML 1.0 Strict and CSS for all layout purposes (no...
5
by: Robert J. O'Hara | last post by:
For some time I've made use of the max-width property in CSS to cause my pages to appear as a centered block against a contrasting background. This works well in new browsers (Mozilla, etc.) and...
6
by: Simon Wigzell | last post by:
I have the following funciton that centers my website content for any size window and will center it in real time as the window is expanded or shrunk. It is activated by a onresize="CenterIt();"...
13
by: Raffi | last post by:
Hi, We have an application that requires IE. We recently incorporated CSS scroll areas. The scroll fields are supposed to be centered. They are except for IE5 for the Mac. I have tried various...
3
by: Robert Latest | last post by:
Hello, me again. This time I'd like to align a DIV both horizontally and vertically centered within a larger DIV. The only alignment-relevant CSS property I could think of was text-align, and...
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.