HTML border for table not working?

Jay

New member
That's because the CSS declaration overrides the table's border attribute. If you remove 'class="table1"' from the <table> tag, then the table will use the value of the border attribute. The easiest way to achieve the effect you want is to wrap the table in a <div> tag and apply the "table1" class to the div, e.g.:
<div class="table1">
<table border="1" width="500" height="162">
<!-- table HTML -->
</table>
</div>

Note that your HTML has several errors. You should use a validator. If you don't have an IDE with one, you can use the w3c's here: http://validator.w3.org/
 
So I made a table using HTML code, but the border isn't working. I have a yellow border around it that is working fine, but I mean I want an internal border like border="1" and it's not working.

Here is the code I wrote-

<head>
<title>Table</title>

<style type"text/css">

.table1{
border: dotted;
border-color: #FFFF00;
}

.bgcolor1 {background-color: #0000FF;}

.bgcolor2 {background-color: #330066;}

.bgcolor3{background-color: #FF0000;}

</style>
</head>
<body>
BUT THIS IS WHERE MY PROBLEM COMES IN; BORDER="1" ISN'T WORKING
<table border="1" width="500px"
height="162px" class="table1">
<tr>
<td width="25%" " class=
"bgcolor1"> </td>
<td colspan="3" width="50%">
</td>
<td class="bgcolor3">
</td>
</tr>
<tr>
<td width="25%" ROWSPAN="3">
</td>
<td class="bgcolor1"></td>
<td> </td>
<td class="bgcolor3"></td>
<td width="25%" ROWSPAN="3">
</td>
</tr>
<tr>
<td height="25%"> </td>
<td class="bgcolor2"> </td>
<td> </td>
</tr>
<tr>
<td class="bgcolor3"> </td>
<td> </td>
<td class="bgcolor1"> </td>
</tr>
<tr>
<td width="25%" class="bgcolor3">

</td>
<td colspan="3" width="50%"></td>
<td width="25%" class="bgcolor1">

</td>

</body>
</table>
</html>

Did I type the border part wrong? Did I make an error that I overlooked?

Help is greatly appreciated!
Yeah, my yellow border is working fine...it's the internal border that's not working for me.
 
When viewing locally, I see the table border of 1..when I make it 0 it disappears as it should...am I missing something? It appears to be working for me...
 
It is working fine for me as well with the code you provided i have a yellow dotted border along my table. maybe your not saving your file properly, or try hitting refresh ?
 
It is working fine for me as well with the code you provided i have a yellow dotted border along my table. maybe your not saving your file properly, or try hitting refresh ?
 
Back
Top