Center website

H

Hugo

Hey guys,

I want to center a table that is bigger than my screen resolution. So
in other words the middle of the table has to be in the middle of my
screen and on any other resolution it has to be the middle. How is
this possible?

<div align="center"> does not work
the whole <table><tr><td align="center"> ... does also not work

Any ideas? Thanks
 
R

Roderik

Hugo schreef:
Hey guys,

I want to center a table that is bigger than my screen resolution. So
in other words the middle of the table has to be in the middle of my
screen and on any other resolution it has to be the middle. How is
this possible?

<div align="center"> does not work
the whole <table><tr><td align="center"> ... does also not work

Any ideas? Thanks

If it has to be centered when the table is wider than your browser
viewport you need some javascript to scroll to the right position
(consider asking in comp.lang.javascript).
 
R

richard

Hey guys,

I want to center a table that is bigger than my screen resolution. So
in other words the middle of the table has to be in the middle of my
screen and on any other resolution it has to be the middle. How is
this possible?

<div align="center">

This tells the content of the division to be centered.
does not work
the whole <table><tr><td align="center"> ... does also not work

Again, the content of the data cell is centered, not the table.

You might want to try <center><table></table></center>
You should also learn the proper methods to code using CSS.
 
B

Beauregard T. Shagnasty

Hugo said:
I want to center a table that is bigger than my screen resolution. So
in other words the middle of the table has to be in the middle of my
screen and on any other resolution it has to be the middle. How is
this possible?

What's in this table?

I do not think what you describe is possible. To do so, would require a
horizontal scrollbar to "start in the middle." And hat will you do for
me? My monitor is 1680 pixels wide, but my browser window is probably
750-800 pixels.

Use a flexible design instead.
 
T

Travis Newbury

<div align="center"> does not work
the whole <table><tr><td align="center"> ... does also not work
Any ideas? Thanks

What are you really trying to do? Having a table that is larger than
the "screen resolution" (or browser window) and centering it will mean
that you want the use to scroll left and right. My guess is that
rather than scroll left and right, they will just look at you as
incompetent and go elsewhere.
 
R

richard

I think you meant <div style="text-align:center;">


I was showing that his coding was in error and how to correct it.
Align and text-align are two different things.
 
S

Steve Pugh

I was showing that his coding was in error and how to correct it.

But your correction was a bigger error than his original. At least his
was valid HTML, your's was just made up rubbish.
Align and text-align are two different things.

There are indeed. One of them is an HTML attribiute and one of them is
a CSS property.

There is no align property in CSS (see http://www.w3.org/TR/CSS21/propidx.html)
so style="align: center" is nonsense.

To align the text contents of a block use text-align: center; To align
the block itself use margin-left: auto; margin-right: auto;
The HTML align="center" does both and a bit more (it also aligns any
child blocks) and has no single equivalent in CSS.

Steve
 
E

Els

richard said:
I was showing that his coding was in error and how to correct it.

In order to show people how to correct things, it does help to show
them correct examples.
Align and text-align are two different things.

You are correct of course, as the text-align property exists in CSS,
and the align property doesn't. Entirely different things indeed :)
 
R

richard

In order to show people how to correct things, it does help to show
them correct examples.


You are correct of course, as the text-align property exists in CSS,
and the align property doesn't. Entirely different things indeed :)


I was attempting to point out why his method was failing and that he
should learn more about how to correct it himself.
Trying to point out that table coding and division coding have
different conventions. As he was failing to understand how and when to
use the proper coding to achieve what he wanted.
Even though what he really wants to have happen, ain't gonna happen.
 
J

Jukka K. Korpela

Scripsit Steve Pugh:
To align the text contents of a block use text-align: center; To align
the block itself use margin-left: auto; margin-right: auto;
The HTML align="center" does both and a bit more (it also aligns any
child blocks) and has no single equivalent in CSS.

It's a bit more complicated than that. The attribute align="center" does
different things depending on which element you use it. For a <div>, it
centers each line and each inner block but not the <div> block itself
(as you can see by setting a width on it). For a <table>, it centers the
table block only.
 
D

dorayme

Steve Pugh said:
To align the text contents of a block use text-align: center; To align
the block itself use margin-left: auto; margin-right: auto;
The HTML align="center" does both and a bit more (it also aligns any
child blocks) and has no single equivalent in CSS.

Someone or other might find this draft of something I knocked up useful:

<http://netweaver.com.au/centring/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top