how to center a complete table?

Hi all,
the problem i have is that i have to center a table on a website. Both for
screen and for printing. Only with ie i can center the table, all other
browsers leave the table at the left border. Until now, i have some
workaround and place the table at an absolute position using some css-class.
But every time the page size changes, i have to change my css file too.

Advertisements

"Beauregard T. Shagnasty" <> schrieb im
Newsbeitrag news:9uw8j.46017$...
> Christian Stüben wrote:
>> the problem i have is that i have to center a table on a website. ...
>> Any hints how i can center the table?
> Perhaps if you posted the URL to your best effort so far, advice could
> be given.

If you want to make a complete "printout", try www.drucke-meinen-kalender.de
upload the pictures, and press start printing. Until now, the pages are only
german, english translation will come later. And yes, i know, the screen
layout is ugly ugly ugly ;-)

On Dec 14, 8:46 am, Christian Stüben <> wrote:
> "Beauregard T. Shagnasty" <> schrieb im
> Newsbeitragnews:9uw8j.46017$....
>
> > Christian Stüben wrote:
> >> the problem i have is that i have to center a table on a website. ...
> >> Any hints how i can center the table?
> > Perhaps if you posted the URL to your best effort so far, advice could
> > be given.
>
> Ok, here it is...www.drucke-meinen-kalender.de/druck2008.aspx
> The problem is the calendar table below the picture.
>
> If you want to make a complete "printout", trywww.drucke-meinen-kalender.de
> upload the pictures, and press start printing. Until now, the pages are only
> german, english translation will come later. And yes, i know, the screen
> layout is ugly ugly ugly ;-)
>
> greetings from germany
> Chris

Often, the solution is nearer than you think ;-) Thanks.
But ... visual studio allways told me that <center> is obsolete and should
be replaced by other constructs. And selfhtml too tells it is deprecated.http://de.selfhtml.org/html/text/bereiche.htm#block_zentriert
So i have been searching for the "other construct". Until i found a solution
by css or something else, i have switched back to <center>. It is now
online.
> You really need to validate the page

Ehem, yes. But again ... there i depend on what visual studio and iis and
asp dot net are generating.

Scripsit a-ok-site:
>>> <center>table here</center> would be the easiest.
- -
> It works and was easy.

This just indicates lack of testing. You only viewed it on faulty
browsers.

If you wanted to be quick and dirty, you could have used
<table align="center">
which is actually easier and has the defined (and factual) effect of
centering the table, without affecting the centering of lines within
table cells.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!