![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've looked at manuals and experimented until my brain's oozing out of my ears, and I still can't figure out what I anticipate will prove to be fairly basic css layout knowledge. I'd be amazed if this was the first (or even if only the 100th) time someone has asked about this sort of situation. So I apologise, not least for the awkwardness of my attempt below to illustrate my ignorance. I could produce a table such as this... table width="400" border="1" tr td width="300" p>...I can put a lot of stuff in this 'CELL 1' knowing that now matter how full it gets, or whatever the browser font-size is set to, the next cell in this row could have just one character and it will always sit neatly at the bottom right:</p /td td width="100" align="right" valign="bottom" p>2</p /td /tr tr td colspan="2" p>I also know that as the bottom border of the cells above expands down to accomodate the contents, 'CELL 3' will maintain its relative position beneath them, and so on for any more rows I include.</p /td /tr /table I just can't get my head around how to successfully position divisions to match such an arrangement of cells. The nearest I got was with an outer division, nesting a 'float: left' [i.e. as per CELL 1] div and a 'float: right' [as per 2] div, but unless I specified a height for the right-floated div (which of course would be rendered useless if someone maximised the font size in their browser) I had no way to shift its single character down to match the bottom border of the left-floated div... and even then I was cludging it... Plus, as I understand it, floated divisions are taken out of the normal 'flow', so trying to make sure that the contents of Cell 3 stays neatly beneath the two divisions above isn't so assured. I really want to stick with css, with tables reserved as a last resort. Obviously I'd be very happy to see an elegant bit of css that does the business, but the URL of a decent (i.e. comprehensible) webpage would be great. Thanks for getting this far! |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I'd still appreciate [positive] comments on any of this! |
#5
| |||
| |||
|
|
I'd be amazed if this was the first (or even if only the 100th) time someone has asked about this sort of situation. So I apologise, not least for the awkwardness of my attempt below to illustrate my ignorance. I could produce a table such as this... |
|
td colspan="2" p>I also know that as the bottom border of the cells above expands down to accomodate the contents, 'CELL 3' will maintain its relative position beneath them, and so on for any more rows I include.</p /td |
#6
| |||
| |||
|
|
On Fri, 20 Aug 2004 16:58:17 +0100, glutinous <glutinosity (AT) yahoo (DOT) co.uk wrote: I'd be amazed if this was the first (or even if only the 100th) time someone has asked about this sort of situation. So I apologise, not least for the awkwardness of my attempt below to illustrate my ignorance. I could produce a table such as this... snip td colspan="2" p>I also know that as the bottom border of the cells above expands down to accomodate the contents, 'CELL 3' will maintain its relative position beneath them, and so on for any more rows I include.</p /td Well you've described what you want. What you haven't done is described why you want it. There are quite a few site layouts that have grown up in a particular way because that's what they happened to look like if you did them in tables. If you slavishly try to recreate identical layouts in CSS, you may well hit problems. The thing is to find a layout that looks good and presents the information well, without worrying about whether it looks the same as the table equivalent. |
|
I perhaps differ from most of the regulars here in one respect: if you want a layout to actually look like a table - say a 3x3 grid with visible borders or chequerboard background colours - then I personally think you might as well make it a layout table. But if you just want a header, sidebar and footer, than CSS will do it a lot more easily and flexibly. As soon as you start getting rowspans and colspans then it's time to drop tables for layout. |
| To give you some (I hope) encouragement: I've been redoing a frames/tables/Javascript layout. (It started as a translation exercise from Dutch to English, but I came across so many structural problems that I got permission to redo the site - particularly visibility for search-engines was the clincher.) Anyway, the total size of the HTML files reduced from 1Mb to under 350Kb, and I think that is a fair indication of the degree of simplification I've achieved. The layout isn't quite the same, and some people didn't like the on-screen changes all that much (though they admitted that it was perhaps just a question of what they'd been used to). But the printed pages look vastly better, and so is the layout in a small window. |
#7
| ||||
| ||||
|
|
glutinous <glutinosity (AT) yahoo (DOT) co.uk> wrote: I'd still appreciate [positive] comments on any of this! They were out of positive comments in my local store. I'd wager that the reason why no-one replied so far is that we are tired of yet another "how can css be any good when it can't do this: [mock table]". |
|
You cannot replace all table layouts with a css layout, not even with css tables (which are not supported by IE). |
|
Feel free to now start proclaiming that css must therefore suck (we see that happening a lot also). |
|
In the unlikely event that you are willing to open your mind and learn something, post a url with an example that uses real content and we'll show you methods to create an attractive css layout. Note that this requires a willingness to accept that you are probably trying to do something which you shouldn't be trying in the first place. |
![]() |
| Thread Tools | |
| Display Modes | |
| |