Jump to content
xisto Community
it01y2

Css Table Scaling

Recommended Posts

I am currently new to css and html, i need to scale the table and pictures so it is 100% of the window width. Here's the code:

<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">	<tr>		<td width="01%">		<img border="0" src="sdmenu/LEFTBOTTOM.GIF" width="10" height="25"></td>		<td width="481" style background="sdmenu/main2.GIF">		<p align="right"><b><font size="1" face="Arial"> | 		<a target="rtop1" href="mainframe.htm">Home</a> | 		<a target="rtop1" href="gallery.htm">Gallery</a> |		<a target="rtop1" href="aboutus.htm">About Us</a> |		<a target="rtop1" href="contactus.htm">Contact 		Us</a> |</font></b></td>		<td width="317" style background="sdmenu/main2.GIF">		<p align="right"><font style="font-size: 8pt">		<font face="Times New Roman">Š </font>Rockin and rollin 2007</font></td>		<td width="1%"><img border="0" src="sdmenu/RIGHTBOTTOM.GIF" width="10" height="25"></td>	</tr></table>

I have uploaded it onto this website for testing http://forums.xisto.com/no_longer_exists/

Any ideas?

Share this post


Link to post
Share on other sites

the margins and padding are left on by default causing the spaces. these values are different for each type of browser so setting it to always to 0 is best practice and then assigning any margins or paddings for other elements as needed

<body margin='0' padding='0'>

that code should do it. Your also not using css its just html code by the way. Best way to format and style your webpage is using CSS.w3schools.com is a great site to start out learning.good luck.

Share this post


Link to post
Share on other sites

I thought that would of worked but it didnt sorry.add this it worked for me I just tried it out now.

<html><head><meta http-equiv="Content-Language" content="en-gb"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>New Page 2</title><style>body{margin: 0px;padding 0px;}</style>

Share this post


Link to post
Share on other sites

Width of 100% on the table will cause the table to be 100% of the *container* it resides in.And some Browsers handle width to be only as wide as the content contained inside it.We would need a link to the page or a posting of the entire page to assist further.

Share this post


Link to post
Share on other sites

np thanks for the help anyway, it works now, here's the code:

<body><table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">	<tr>		<td style="size:auto;">		<img border="0" src="sdmenu/LEFTBOTTOM.GIF" width="10" height="25"></td>		<td width="60%" style background="sdmenu/main2.GIF" style="background-repeat:repeat-x;">		<p align="right"><b><font size="1" face="Arial"> | 		<a target="rtop1" href="mainframe.htm">Home</a> | 		<a target="rtop1" href="gallery.htm">Gallery</a> |		<a target="rtop1" href="aboutus.htm">About Us</a> |		<a target="rtop1" href="contactus.htm">Contact 		Us</a> |</font></b></td>		<td width="40%" style background="sdmenu/main2.GIF">		<p align="right"><font style="font-size: 8pt">		<font face="Times New Roman">Š </font>Rockin and rollin 2007</font></td>		<td width="1%"><img border="0" src="sdmenu/RIGHTBOTTOM.GIF" width="10" height="25"></td>	</tr></table></body>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.