JQuery - define div as grid
if you ask to build a grid in a div, you can only accomplish this with CSS. There is a CSS template called 960 which will render the page with a grid in 12px or 16px increments and will keep track of alignment and spacing.
This will help you accomplish your "anchor" task, since any element placed in columns will adhere to the rules of the container div.
The site has a link to a grid generator where you can reproduce the grid width and view the results.
WARNING. Once you've laid out your pages with a CSS grid, you are in danger of reluctance to use tables, as CSS is easier to manipulate, and with a system like 960 you can take advantage of browser support out of the box.It might be good!
a source to share
If you are trying to draw a grid then you will need as many divs as you need, giving them some kind of border, all floating left or right. Only then secure the content inside them.
But if you only want to layout the content as a grid, you only need to set fixed widths and heights for all divs, float them to the left and you're done.
a source to share