HTML表:单元格内容编辑的属性?

问题描述 投票:0回答:2

我想编辑HTML表格中单元格的内容。

是否有编辑属性或我必须使用某种脚本?

html html-table editing
2个回答
1
投票

如果您不想手动执行此操作,则必须为attribute定义td,然后通过css,您必须通过声明:after:before类来应用所需的内容。

例如,这是WORKING SOLUTION

HTML:

<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td title="abc">&nbsp;</td>
    <td title="def">&nbsp;</td>
  </tr>
</table>

CSS:

td[title=abc]:after{content:"red"}
td[title=def]:after{content:"blue"}

我希望这就是你想要的。


1
投票

自己找到了答案..只需进入想要的单元格并将contenteditable属性放入:

<td contenteditable>Whatever</td>
© www.soinside.com 2019 - 2024. All rights reserved.