【问题标题】:ID for cell in 1x1 html table?1x1 html表格中单元格的ID?
【发布时间】:2014-07-30 10:39:19
【问题描述】:

我可以找到或给一个 1x1 html 表格单元格一个 ID 吗?

我想使用document.getElementById.style.background 来动态更改单元格的背景图片。

【问题讨论】:

  • 你可以给任何DOM元素一个ID,单元格不一样
  • 你想完成什么?如果您有一个 1x1 单元格的表格,您是否可能正在尝试使用它来显示可能使用 <canvas> 元素更好地显示的内容?

标签: html html-table background-image cell


【解决方案1】:

谢谢,我使用表格单元格来保持正确的位置。我得到了以下代码:

document.getElementById("frameCell").style.backgroundImage="url('myBackgroundImage.jpg')";

供以下人员使用:

:)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-12
    • 1970-01-01
    • 2019-06-22
    • 2013-12-11
    • 2010-11-12
    • 2018-12-21
    • 1970-01-01
    相关资源
    最近更新 更多