/    Sign up×
Community /Pin to ProfileBookmark

At the center of the browser window…

Hello,

I am having a problem with positioning a table on my page. I am trying to position a small 50×50 table below another “very wide” one, and at the center of the browser window [B](Not at the center of the whole wide page)[/B]. So I want the position of that 50×50 table to be fixed vertically, but varying horizontally [B]to keep the table at the center of the browser window [/B] (horizontal and not vertical center) when the user scrolls the page horizontally (left-right, right-left).
Is it possible to position the table in that way???

Here’s a sample of my page:

[CODE]<HTML>
<body>
<table width=”2000″ height=”200″>
[COLOR=Red]This table contains many <tr>’s, <td>’s, text, images…[/COLOR]
</table>

<table cellpadding=”0″ cellspacing=”0″ width=”50″ height=”50″>
<tr>
<td width=”25″ height=”25″ bgcolor=red></td>
<td width=”25″ height=”25″ bgcolor=blue></td>
</tr>
<tr>
<td width=”25″ height=”25″ bgcolor=blue></td>
<td width=”25″ height=”25″ bgcolor=red></td>
</tr>
</table>

</body>
</HTML> [/CODE]

P.S. Don’t say CSS ?

Thanks in advance!

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayFeb 07.2006 — This will initially position it centered, but to keep it there when you scroll horizontally will require some JS coding....

<i>
</i>&lt;HTML&gt;
&lt;body&gt;
&lt;table width="2000" height="200"&gt;
This table contains many &lt;tr&gt;'s, &lt;td&gt;'s, text, images...
&lt;/table&gt;
&lt;div style="text-align:center"&gt;
&lt;table cellpadding="0" cellspacing="0" width="50" height="50"&gt;
&lt;tr&gt;
&lt;td width="25" height="25" bgcolor=red&gt;&lt;/td&gt;
&lt;td width="25" height="25" bgcolor=blue&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td width="25" height="25" bgcolor=blue&gt;&lt;/td&gt;
&lt;td width="25" height="25" bgcolor=red&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/HTML&gt;
Copy linkTweet thisAlerts:
@ErolinDesignsFeb 07.2006 — Create a new table row and a cell spanned across the entire table (the first one with 2000 pxls wide). Insert your secondary table in that cell.

For example:

[code=html]<table width="2000" height="200">
This table contains many <tr>'s, <td>'s, text, images...
<tr>
<td colspan="total of columns" valign=top align=center>
<table cellpadding="0" cellspacing="0" width="50" height="50">
<tr>
<td width="25" height="25" bgcolor=red></td>
<td width="25" height="25" bgcolor=blue></td>
</tr>
<tr>
<td width="25" height="25" bgcolor=blue></td>
<td width="25" height="25" bgcolor=red></td>
</tr>
</table>
</td>
</tr>
</table>[/code]
×

Success!

Help @chem3 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...