Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Semi-fluid layout?


Go to End


4 Posts   1555 Views

Avatar
saimo

Community Member, 67 Posts

21 February 2008 at 8:22am

Edited: 21/02/2008 8:25am

Is it possible to make a div resize according to the browser window, but only within sertain limits? using only css that is.

Also, is it possible to tell a table to never get any wider than its parent width so that it will never get outside that box?

Edit: joomla.org is a good example of what I mean with semi-fluid layout, and it works with js disabled, so css should probably be enough.

Avatar
KatB

Community Member, 105 Posts

21 February 2008 at 1:59pm

Is it possible to make a div resize according to the browser window, but only within sertain limits?

Depending upon your needs, you could set the div a width in percentage, and then put min-width and max-width to your certain limits, eg. ems.

However, take note that IE 6 and former do not respect min-width and max-width.

Is this the kind of thing you were after?

Also, is it possible to tell a table to never get any wider than its parent width so that it will never get outside that box?

OK I am no table expert, but surely that should be standard unless it cannot (the content of the table cannot wrap smaller)? What are you experiencing?

NB. Use tables only for tabulated data, not for layout.

Avatar
saimo

Community Member, 67 Posts

21 February 2008 at 11:52pm

Is this the kind of thing you were after?
It probably is, though I haven't tested it yet.

About tables, it is possible to make tables in the cms, and its also possible to make the width wider than the avaliable content area. This could get a big problem, when for example changing themes to a less wide theme.

This leads to another question: maybe silverstripe should support xhtml/html fragments? That would be located in the themes as a fragments subfolder and would be ss templates, for example table.ss. This would allow a great deal of customizeability of the markup itself.

Avatar
saimo

Community Member, 67 Posts

23 February 2008 at 2:54am

Just wanted to inform anyone intersted that I solved the table issue by adding

table {
max-width:100%;
}

to layout.css.
I have also confirmed that the "joomla-style" page width is possible using the css posted above, so thanks for the help!