views:

80

answers:

1

Hi,

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.

Thanks

A: 

If you're willing to use script and css, then you could:

  • Define a CSS rule, associated with a class, which looks like (e.g. is colored like) the text is selected
  • Track mouse events (using the DOM event API)
  • Using script attached to mouse events, dynamically set the class attribute of table cells (to make it seem selected, using the CSS rule)

I haven't tested this! It's just an idea (not necessarily a good idea; but an answer to your question as stated).

ChrisW