0

Is there anyway to get the text on an HTML table to be selectable like the tables in MS Word? In a normal html table, when the user selects text using the mouse, the text is selected in ROWS. In MS Word, it is selected in COLUMNS. I am using IE8 in standard mode. I don't mind if the solution uses script or css.

Any help would be appreciated.

4

1 回答 1

0

如果您愿意使用脚本和 css,那么您可以:

  • 定义一个 CSS 规则,与一个类相关联,它看起来像(例如,颜色像)被选中的文本
  • 跟踪鼠标事件(使用 DOM 事件 API)
  • 使用附加到鼠标事件的脚本,动态设置表格单元格的类属性(使其看起来被选中,使用 CSS 规则)

我没有测试过这个!这只是一个想法(不一定是一个好主意;但如前所述,可以回答您的问题)。

于 2009-10-01T02:54:44.443 回答