Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML表格:单元格内容编辑的属性?_Html_Html Table_Editing - Fatal编程技术网

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

HTML表格:单元格内容编辑的属性?,html,html-table,editing,Html,Html Table,Editing,我想编辑HTML表中单元格的内容 是否有用于编辑的属性,或者我必须使用某种脚本?如果您不想手动执行此操作,那么您必须为td定义属性,然后通过css,您必须通过声明:在类之后或:在类之前来应用所需的内容 例如,下面是 HTML: <table width="100%" border="1" cellspacing="0" cellpadding="0"> <tr> <td title="abc">&nbsp;</td> &

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


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

如果您不想手动执行此操作,那么您必须为
td
定义
属性,然后通过css,您必须通过声明
:在
类之后或
:在
类之前来应用所需的内容

例如,下面是

HTML:

<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td title="abc">&nbsp;</td>
    <td title="def">&nbsp;</td>
  </tr>
</table>
td[title=abc]:after{content:"red"}
td[title=def]:after{content:"blue"}

我希望这就是你想要的。

我自己找到了答案。。只需进入想要的单元格,并将
contenteditable
属性如下:

<td contenteditable>Whatever</td>
不管怎样
thx,但我只是在寻找一个html属性,允许我将单元格内容设置为可编辑。。。我发现它与一个更好的谷歌研究:)。。属性是contenteditable.Oh。我以为您想在
td
中推送内容,而不需要手动在页面上放置任何内容。-@LutherBlissetI建议您检查w3规范,因为
td
可能支持也可能不支持此属性。它可用于Div标记。例如,在HTML5 CR中,
contenteditable
是为所有元素定义的通用属性;在早期的HTML规范中,它根本不存在。True@JukkaK.Korpela我不知道,所以告诉他检查并确认td可能支持或不支持此属性。Thnx的信息。