我想编辑HTML表格中单元格的内容。
是否有编辑属性或我必须使用某种脚本?
如果您不想手动执行此操作,则必须为attribute
定义td
,然后通过css,您必须通过声明:after
或:before
类来应用所需的内容。
例如,这是WORKING SOLUTION
HTML:
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td title="abc"> </td>
<td title="def"> </td>
</tr>
</table>
CSS:
td[title=abc]:after{content:"red"}
td[title=def]:after{content:"blue"}
我希望这就是你想要的。
自己找到了答案..只需进入想要的单元格并将contenteditable
属性放入:
<td contenteditable>Whatever</td>