Reputation: 21
im new to this forum and i'm having some trouble with my code. I used a table for a navigation bar and after changing something, i couldn't get the links to work! They will not even allow me to right click and open in new tab. Below is a sample of my code.
<div class="bod">
<table id="nav" cellspacing= 10px >
<td><a href="index.html">Home</a></td>
<td><a href="#about.html">About</a></td>
<td><a href="gallery.html">Gallery</a></td>
<td><a href="#contact.html">Contact us</a></td>
</table>
</div>
<div class= "container">
<table class="mid">
<td><a href="#" class="point" id ="left" onclick="prev(); return false;" ><img src="images/left.png" width="30px"></a></td>
<td> <div id="slider">
<img id="1" src="images/1.jpg">
<img id="2" src="images/2.jpg">
<img id ="3" src="images/3.jpg">
<img id ="4"src="images/4.jpg">
</div>
</td>
<td>
<a href="#" class="point" id="right" onclick="next(); return false;"><img src="images/right.png" width="30px"></a>
</td>
</table>
</div>
Upvotes: 2
Views: 54
Reputation: 1076
Apologies, accidentally hit post too soon. updated:
All elements must belong to a <tr>
element, like so:
<table id="nav" cellspacing= 10px >
<tbody>
<tr>
<td><a href="index.html">Home</a></td>
<td><a href="#about.html">About</a></td>
<td><a href="gallery.html">Gallery</a></td>
<td><a href="#contact.html">Contact us</a></td>
</tr>
</tbody>
</table>
However, you should not be using tables for presentational styling anyway; you should only be using them for tabular data.
Upvotes: 1
Reputation: 5135
If you mean that about.html
link or contact.html
link doesn't work, is because you have the # in front of them and make sure you are surrounding the <td>
tags with a <tr>
tag
Upvotes: 1