Reputation: 183
I'm writing a code for the following table and it doesn't seem to display in the browser. I checked my code to see if there is some typo, and I can't find any.
Here's what the table has to look like:
And here's my code:
<html>
<body>
<table>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan=3> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td rowspan=2></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
Upvotes: 1
Views: 6039
Reputation: 8091
You can use the HTML border, width and height attribute of the table:
<table border="1" width=500px height=500px>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan=3> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td rowspan=2></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
This is how we did this when we started learning HTML :)
Upvotes: 2
Reputation: 43810
The table is invisible until you add styling and data to it.
CSS:
table {
border-collapse:collapse;
}
table td {
border:1px solid #000;
}
Without CSS but not recommended is to use the border attribute:
<table border="1" cellspacing="0">
Upvotes: 4
Reputation: 3499
This works.. I just tested it..
<html>
<body>
<table border=1>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan=3> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td rowspan=2> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
Upvotes: 2