How create table via div which always centered their cells. I mean, if width for example 302 px, table show 3 divs in one line with width of 90px, and space between those divs and border are equal (8px). And if table width changed to 210px, 2 div will shown in one line with equal space (10px), and third div will move to the next line. Window width is dynamic.
Asked
Active
Viewed 455 times
1
-
Please clarify your math, I don't see how 3*90+ 3*8 = 302 it is 294 right? – Cisum Inas May 02 '14 at 20:44
-
I belive my answer is still solid, I would suggest you drop the table all togheter and focus on css + html divs, the html tables are a barren path... – Cisum Inas May 02 '14 at 20:53
-
Sorry,302 is right. If 3(div)*90 + 4(space)*8=302 – ivamax9 May 02 '14 at 20:55
-
Ok if you say so, but I figure like this div a, div b, div c = 90+8+90+8+90 = 270 + 16 = 286 which means both of us where wrong... – Cisum Inas May 02 '14 at 20:59
-
8+90+8+90+8+90+8 it's what I mean. But if you know solution for your example it will be helpful. – ivamax9 May 02 '14 at 21:04
-
You can use css for this if you use bootstrap – Cisum Inas May 02 '14 at 21:25
1 Answers
1
I would suggest using css and frameworks such as: twitter bootstrap or zurb foundationn, Check this out to get the overlaying image about responsive frameworks these have pre-set setups but you can also modify them to your liking..
You would need to change
x,y,z
to suit you because I don't exactly follow your math, HTML tables are out dated and should not be used!
<div class="row">
<div class="col-md-x">.col-md-4</div>
<div class="col-md-y">.col-md-4</div>
<div class="col-md-z">.col-md-4</div>
</div>

Community
- 1
- 1

Cisum Inas
- 11,552
- 11
- 40
- 55