Mode 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.

I can select columns in FF by holding down the Ctrl key. Anyway to do the same in IE?

Any help would be appreciated.


  • Are you looking for a solution for just your own use? or something you can use on your html page for everyone to use? Tony Crockford almost 10 years ago
  • Hi Tony, Its for a project I am doing. I don't mind sharing. Mode almost 10 years ago

1 answer

danwellman 5600

See this page for information on the textRange JavaScript object which can be used to select text, copy it, edit it, etc. Using this method it should be possible to set click handlers on the th elements in the table to programmatically select the rest of the text in the column. You'll probably need to count rows and stuff and if I remember correctly there are different implmentations of this in different browsers but it should be possible to get something workable with relatively little code...

Answered almost 10 years ago by danwellman
  • Hi Dan, Yeah that's what I thought and I have an implementation of it though its not working that great. The main problem is that unlike FF, IE doesn't support multi selecting or multiple discontinued active text ranges. So if i cover each td in a text range and call "Select" on each of them only the last one would remain highlighted. So I was wondering if there was another way. Mode almost 10 years ago