Using something like the following code:
<body >
<center>
<table class = "maintable">
<tr>
<td > Hello</td>
</tr>
</table>
</body>
The class maintable set tsble width as
.maintable
{
width: 70%;
}
My problem is that I cannot get the table to become narrower than 70%. When I enter 50% - the table remains at the same size. IF I enter 90% then it grows bigger.
My question is what could be stopping the table from showing itself at 50%?
I assumed that content inside the table is set in relation to the outer table. ie inside cell width == 100% is olny as wide ai its parent tag. Am I right about this or is this where I have gone wrong??
Johntry this
<html>
<head>
<title>Center table</title>
<style type="text/css">
body{
text-align: center;
}
.maintable{
border: 1px solid #000;
width: 50%;
margin: auto;
}
</style>
</head>
<body>
<table class="maintable">
<tr>
<td>Hello</td>
</tr>
</table>
</body>
</html>Your code seems to work fine.
Here is an example of mine:
inside baptiststructure.cc
.maintable
{
width:50%
margin:auto;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href=http://www.webdeveloper.com/forum/archive/index.php/"CSS/baptisttext.css" rel="stylesheet" type="text/css">
<link href=http://www.webdeveloper.com/forum/archive/index.php/"CSS/baptiststructure.css" rel="stylesheet" type="text/css">
</head>
<body >
<center>
<table class = "maintable">
<tr>
<td colspan="4"><img src=http://www.webdeveloper.com/forum/archive/index.php/"Images/banner.png" width="100%" height="176"></td>
</tr>
<tr>
<td colspan="4" > </td>
</tr>
<tr>
<td class = "navcell" > <a href=http://www.webdeveloper.com/forum/archive/index.php/"index.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">HOME</h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"pastor.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">PASTOR</h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"beliefs.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">
BELIEFS </h1>
</a><a href=http://www.webdeveloper.com/forum/archive/index.php/"meetings.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">MEETINGS</h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"photos.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">PHOTOS</h1>
</a><a href=http://www.webdeveloper.com/forum/archive/index.php/"docs.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">DOCUMENTS</h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"guestbook.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">GUEST
BOOK </h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"findus.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">FIND
US </h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"contact.htm">
<h1 class = "focus" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'focus';">CONTACT</h1>
</a>
</td>
<!-- main conctent -->
<td colspan="2" rowspan="2" >
<table >
<tr>
<td class = "contact"><p class = "contactbodytext"><span class="contactpageheading">Pastor
</span><br>
Jim Newell <br>
'Bermuda'<br>
39 Grattan Place <br>
Fraserburgh <br>
AB43 7YU <br>
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --> <br>
</p></td>
<td class = "contact"><p class = "contactbodytext"><span class="contactpageheading">Secretary
</span><br>
Jim May <br>
16 Cairnhill Road<br>
Fraserburgh <br>
AB43 7YU <br>
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --></p></td>
<td class = "contact" ><p class = "contactbodytext"><span class="contactpageheading">Correspondance
Secretary </span><br>
Gary Sutherland <br>
29 Alexandra Terrace <br>
Fraserburgh <br>
AB43 7YU <br>
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --></p></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class = "contact"><p class = "contactbodytext"><span class="contactpageheading">Treasurer
</span><br>
Margaret Wilson <br>
66 Grattan Place <br>
Fraserburgh <br>
AB43 7YU <br>
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --> </p></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class = "contact"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class = "contact"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class = "contact"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class = "contact"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3" class = "verse">And He said unto them, "Go ye
into all the world, and preach the gospel to every creature".
Mark 16:15-16</td>
</tr>
<tr>
<td colspan="3" class = "verse"> </td>
</tr>
</table>
</td>
<td rowspan="2" class = "rightspacer"> </td>
</tr>
<tr>
<td class = "navcell"> </td>
</tr>
<tr>
<td colspan="4" class = "footer"><img src=http://www.webdeveloper.com/forum/archive/index.php/"Images/footer.png" width="100%" height="15"></td>
</tr>
</table>
</center>
</body>
</html>
Can you see where the error may lie
<body >
<center>
<table class = "maintable">
<tr>
<td > Hello</td>
</tr>
</table>
</body>
The class maintable set tsble width as
.maintable
{
width: 70%;
}
My problem is that I cannot get the table to become narrower than 70%. When I enter 50% - the table remains at the same size. IF I enter 90% then it grows bigger.
My question is what could be stopping the table from showing itself at 50%?
I assumed that content inside the table is set in relation to the outer table. ie inside cell width == 100% is olny as wide ai its parent tag. Am I right about this or is this where I have gone wrong??
Johntry this
<html>
<head>
<title>Center table</title>
<style type="text/css">
body{
text-align: center;
}
.maintable{
border: 1px solid #000;
width: 50%;
margin: auto;
}
</style>
</head>
<body>
<table class="maintable">
<tr>
<td>Hello</td>
</tr>
</table>
</body>
</html>Your code seems to work fine.
Here is an example of mine:
inside baptiststructure.cc
.maintable
{
width:50%
margin:auto;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href=http://www.webdeveloper.com/forum/archive/index.php/"CSS/baptisttext.css" rel="stylesheet" type="text/css">
<link href=http://www.webdeveloper.com/forum/archive/index.php/"CSS/baptiststructure.css" rel="stylesheet" type="text/css">
</head>
<body >
<center>
<table class = "maintable">
<tr>
<td colspan="4"><img src=http://www.webdeveloper.com/forum/archive/index.php/"Images/banner.png" width="100%" height="176"></td>
</tr>
<tr>
<td colspan="4" > </td>
</tr>
<tr>
<td class = "navcell" > <a href=http://www.webdeveloper.com/forum/archive/index.php/"index.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">HOME</h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"pastor.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">PASTOR</h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"beliefs.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">
BELIEFS </h1>
</a><a href=http://www.webdeveloper.com/forum/archive/index.php/"meetings.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">MEETINGS</h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"photos.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">PHOTOS</h1>
</a><a href=http://www.webdeveloper.com/forum/archive/index.php/"docs.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">DOCUMENTS</h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"guestbook.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">GUEST
BOOK </h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"findus.htm">
<h1 class = "normal" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'normal';">FIND
US </h1>
</a> <a href=http://www.webdeveloper.com/forum/archive/index.php/"contact.htm">
<h1 class = "focus" onmouseOver = "this.className = 'focus';"onmouseout = "this.className = 'focus';">CONTACT</h1>
</a>
</td>
<!-- main conctent -->
<td colspan="2" rowspan="2" >
<table >
<tr>
<td class = "contact"><p class = "contactbodytext"><span class="contactpageheading">Pastor
</span><br>
Jim Newell <br>
'Bermuda'<br>
39 Grattan Place <br>
Fraserburgh <br>
AB43 7YU <br>
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --> <br>
</p></td>
<td class = "contact"><p class = "contactbodytext"><span class="contactpageheading">Secretary
</span><br>
Jim May <br>
16 Cairnhill Road<br>
Fraserburgh <br>
AB43 7YU <br>
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --></p></td>
<td class = "contact" ><p class = "contactbodytext"><span class="contactpageheading">Correspondance
Secretary </span><br>
Gary Sutherland <br>
29 Alexandra Terrace <br>
Fraserburgh <br>
AB43 7YU <br>
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --></p></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class = "contact"><p class = "contactbodytext"><span class="contactpageheading">Treasurer
</span><br>
Margaret Wilson <br>
66 Grattan Place <br>
Fraserburgh <br>
AB43 7YU <br>
<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e --> </p></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class = "contact"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class = "contact"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class = "contact"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td class = "contact"> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="3" class = "verse">And He said unto them, "Go ye
into all the world, and preach the gospel to every creature".
Mark 16:15-16</td>
</tr>
<tr>
<td colspan="3" class = "verse"> </td>
</tr>
</table>
</td>
<td rowspan="2" class = "rightspacer"> </td>
</tr>
<tr>
<td class = "navcell"> </td>
</tr>
<tr>
<td colspan="4" class = "footer"><img src=http://www.webdeveloper.com/forum/archive/index.php/"Images/footer.png" width="100%" height="15"></td>
</tr>
</table>
</center>
</body>
</html>
Can you see where the error may lie