First of all, this is stupid ... but it works ... however, it only works in certain cases and includes a lot of stupid numbers. Definitely not modular. FIDDLE (do you need to indicate that you need to resize the browser?)
HTML
<ul> <li>01</li> <li>02</li> <li>03</li> <li>04</li> <li>05</li> <li>06</li> </ul>
CSS
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; padding: 0; margin: 0; } ul { list-style: none; padding: 0; margin: 0; width: 4em; border: 1px solid orange; overflow: hidden; } ul li { position: relative; display: inline-block; border: 1px solid red; width: 2em; height: 2em; float: left; clear: left; } ul li:nth-of-type(n+4) { float: right; clear: none; top: -6em; } @media (min-width: 30em) { ul { width: auto; float: left; } ul li { float: left; clear: none; border: 1px solid green; } ul li:nth-of-type(n+4) { float: left; top: 0; } }
I'm sure there is a nice jQuery for this ... If your table is not dynamically populated with different amounts of information, you can do something like this cosmetically or use some kind of absolute positioning - the columns are probably the way to go though. Good luck ...
source share