We help IT Professionals succeed at work.

How to dynamically close gaps within a table

jagku asked
Hello Experts,

I want to create a table with 3 columns.

Please see this example:

What I want to acheive is the falling output:

->a ->b ->c
->d ->e ->f
->g ->h

If I then remove an element, I want the table to clean up.
Eg, if I remove "->e ":

->a ->b ->c
->d ->f
->g ->h

Is this possible with CSS. I want to be able to add/remove these elements at will and let the css 'tidy' up the table.

Watch Question

Top Expert 2013
You are not going to do it with CSS.   It requires scripting.  The example you post is not a table, it is a list.

In any case we are going to need more information.  If we could see the code for this table, then we would be able to tell you what you need to modify to allow some dynamics, and then we could work out the scripting, which may be siple or complex depending on the actual contents of the table cells.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.