jQuery highlighting selected columns only in a table

后端 未结 6 1108
长发绾君心
长发绾君心 2021-01-02 19:46

I see this post on highlighting even columns but can I highlight only selected columns?

Here is the code they use:

$(\"table.Table22 > tbody >          


        
6条回答
  •  我在风中等你
    2021-01-02 20:33

    If you want to support colspan and rowspan, then first you need to build table cell index, ie. matrix that identifies cell positition in every row regardless of the markup. Then you need to track events of all the table cells of interest and calculate their offset in the matrix and the columns that share the vertical index.

    The resulting lookup is illustrated in the following animation:

    wholly table index

    I have written a plugin that triggers an wholly.mouseenter and wholly.mouseleave events for columns. Wholly.

提交回复
热议问题