Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alignment!!!

Status
Not open for further replies.

AnaIsabelFlor77

Programmer
Mar 17, 2007
12
PT
Hello,

I've created one *.html page with one table inside.
Now I want to align that table to the page, centering the table in the page, horizontally and vertically.
Until now, I've only align the table horizontally. How can I do the same vertically?

In my index.html I have three vertical frames. How can I center each page I put in the frames to do the same side as the frame.

Thanks.
 
This should do it.
Code:
<table align="center" style="width: 100%; height: 100%;">
	<tr>
		<td align="center" valign="middle">This is a test</td>
	</tr>
</table>

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
Thanks ECAR. But now I have another problem.
My table has 3 rows and now the rows are centered in the page, but I want to join the 3 rows. Now they are with many spaces appart.

Can you help me once again?

Thanks
 
You can adjust your width to bring them closer together:
Code:
<table align="center" style="[red]width: 100%;[/red] height: 100%;">
100% means that it spans 100% of the page, you can lower it to make your table smaller. You can also use a specified pixel width instead of percentages. For example, you could say 500px instead of 100%.

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top