Hi @gregoff
Thank you for your feedback. If I understood your requirements correctly, you can do that with a few lines of code. Here is a jsFiddle for same.
In case you are looking for something else, could you please send us a pictorial representation of the requirements so that we can understand it properly and assist you accordingly.
——
Bivek Singh