表格中的锚点

Anchors in tables

我试图 link table 在同一页面中使用一些锚点,但我不知道发生了什么。

Here it works as intended. But with this code 没用。

<table>
  <tr> </tr>
  <tr id="#i0">
    <td style="vertical-align:top"><a href="#section0">150, 166666</a></td>
    <td class="sec"><a href="#section0">PFC CINEMA LAMBRO</a><br>
      <font >Plan du radier et des fondation.</font><br>
      <br></td>
  </tr>
  <tr id="#i1">
    <td style="vertical-align:top"><a href="#section1">151, 165555</a></td>
    <td class="sec"><a href="#section1">AXONOMETRIA/CIMENTACIONES</a><br>
      <font >Projet pour un et des fondation.</font><br>
      <br></td>
  </tr>
  <tr id="#i2">
    <td style="vertical-align:top"><a href="#section2">152, 164444</a></td>
    <td class="sec"><a href="#section2">EXPO - MAD 2015</a><br>
      <font >Exposition des projets du semestre.</font><br>
      <br></td>
  </tr>
  <tr id="#i3">
    <td style="vertical-align:top"><a href="#section3">153, 163333</a></td>
    <td class="sec"><a href="#section3" onclick="closeNav()">PFC CINEMA LAMBRO</a><br>
      <font>Projet pour un cinéma à Milan.</font><br>
      <br></td>
  </tr>
</table>
<div class="Esp"></div>
<a href="#i3">This should make me go up</a>

知道为什么会这样吗?

URL 中片段 ID 的语法是哈希符号后跟元素的 ID。

您的元素 ID 以哈希符号开头。因此,当 href="#id3" 查找带有 id="id3" 的元素时,它找不到。

从元素 ID 中删除散列字符。

您的代码不起作用,因为您在 idhref 属性中都使用了 #。从您的 id 中删除 #,它将起作用。