
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
github.com/mdo/table-grid
Every grid to date uses float
s or some inline-block
hackery. That's so 2013 though, and seeing that it's now 2014, we need something newer, faster, and stronger. So, Table Grid was born.
Check out the example on GitHub Pages at http://mdo.github.io/table-grid/. Clone this or download it to give it a whirl for yourself.
This isn't a serious project really, it's just an experiment. I'm curious about the rendering performance of using display: table;
as opposed to float
s, flex-box
, or display: inline-block;
. Each option has pros or cons, but in particular I'm focused on the con part:
float
s require clearing and I have zero idea about rendering performance. They're straightfoward and Just Work™.flex-box
has poor rendering last I heard because browsers have to do a lot of repainting to support it. I have no references to this, it's what I've heard. Plus, browser support and what not.display: inline-block;
is gnarly because it involves resetting white-space
and that's just silly. We shouldn't be resetting that kind of stuff just for a grid system.So, based on that, display: table;
starts to sound kind of interesting. Table layouts, especially ones that include table-layout: fixed;
render super fast because browsers only need to render the first row of cells to paint the whole table. That's kind of moot with one row grids like this, but it might help anyway.
As always, there's a container, row, and a series of columns. It's responsive, too. More specifically:
.container
, which has a max-width: 940px;
..grid
. This sets up the table-based grid with display: table;
, width: 100%;
, and table-layout: fixed;
..col
base class and a width class, like .col-1
or .col-6
. There are 12 available column classes, 1-12, for any variety of column combinations..col
. Tables, baby!.grid
within any .col
. Bam.display: table;
works, there's no gutters. To add gutters, wrap the .grid
in .grid-padded
, which adds gutters with border-spacing: 1rem 0;
. Sucks, but this is an experiment.All this can be seen in action on the demo page.
Two CSS files to choose from, each under 1kb.
.table-grid.css
— full set of grid classes with column widths.table-grid-simple.css
— only the container, row, and base classChoose either CSS file, but not both. See http://mdo.github.io/table-grid/ for details.
If you need a nuclear hardened grid system, check out Bootstrap. It's pretty cool I guess.
MIT, (c) Mark Otto 2014.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.