3 ms·
A trick that may get the desired effect is spacer TDs -- without specified dimension they'll each expand equally to fill out the desired width. Working example
by gojomo 17y ago
A trick that may get the desired effect is spacer TDs -- without specified dimension they'll each expand equally to fill out the desired width. Working example for Mac FF/Webkit browsers:
http://gist.github.com/386146 http://gist.github.com/386146
edited to add:
Live example, now including liquid-width demo as well: http://xavvy.com/news.yc/html-distribute.html http://xavvy.com/news.yc/html-distribute.html
- treyp 17y agogotta agree -- a table with spacer TDs is going to be your best solution here. like mbrubeck mentioned, justified blocks are going to require a hack since it's the last line of content. perhaps the design can be thought out again, though. instead of getting the first flush with the left and last flush with the right, you could just create a bunch of blocks with centered content (think: floated list items in a list). there will be a little extra spacing on the left and right, but you can design it so that it's not too bothersome. i'm thinking (_A_)_(___B___)_(__C__)_(_D_) instead of (A_______B________C______D) your point about CSS having not really solved this problem yet is a valid one, but solutions are in the works (namely, the flexible box model).
- vinhboy 17y agoNice demo. 100 internetz for you. I will have to remember this the next time the PMs ask me to implement this.