HighDots Forums  

How to frame the body of each page with a table ?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss How to frame the body of each page with a table ? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Winston Smith
 
Posts: n/a

Default How to frame the body of each page with a table ? - 11-03-2004 , 01:36 PM






Hello,

What I would like to do is to frame the body of every page of my web
site with a table like this:

<body bgcolor="#99ccff">
<table bgcolor="#ffffff" align="center" border="1" width="640"><tr><td>
This is my content...
</td></tr></table>
</body>

But I would like to put this once and for all in a single place instead
of editing each of my pages. I thought I could put it in my external CSS
stylesheet with something like:

body:before { content: "<table bgcolor=\"#ffffff\" align=\"center\"
border=\"1\" width=\"640\"><tr><td>"; }
body:after { content: "</td></tr></table>"; }

But the tags are just printed as text on my pages. As stated by the CCS2
Specification: "Generated content does not alter the document tree. In
particular, it is not fed back to the document language processor (e.g.,
for reparsing)."

My question is: is there a way to a way do what I want with CSS?

Thanks for your help,
Winston


Reply With Quote
  #2  
Old   
Christoph Paeper
 
Posts: n/a

Default Re: How to frame the body of each page with a table ? - 11-03-2004 , 01:53 PM






Winston Smith <winston_smith (AT) linuxmail (DOT) org>:
Quote:
body bgcolor="#99ccff"
table bgcolor="#ffffff" align="center" border="1" width="640"><tr><td
This is my content...
/td></tr></table
/body
OTOH You want to use advanced CSS solution, but OTOH are still using
extremely presentational HTML?

Quote:
My question is: is there a way to a way do what I want with CSS?
<body>
This is my content...
</body>

html {
background-color: #9CF;
}
body {
display: table; /*actually there seems to be no
need for a table or this rule*/
background-color: #FFF;
margin: auto;
border: 1px solid;
width: 640px;
}

Or something like that. Don't expect good browser support, you'll probably
have to use a little less sophisticated CSS.

--
Wonko the Sane: "See first, think later, then test. But always see first.
Otherwise you will only see what you were expecting.
Most scientists forget that."
(The Hitchhiker's Guide to the Galaxy)


Reply With Quote
  #3  
Old   
Julian Knight
 
Posts: n/a

Default Re: How to frame the body of each page with a table ? - 11-03-2004 , 02:31 PM



From Winston Smith on 03/Nov/2004 19:36:
Quote:
Hello,

What I would like to do is to frame the body of every page of my web
site with a table like this:

body bgcolor="#99ccff"
table bgcolor="#ffffff" align="center" border="1" width="640"><tr><td
This is my content...
/td></tr></table
/body

But I would like to put this once and for all in a single place instead
of editing each of my pages. I thought I could put it in my external CSS
stylesheet with something like:

body:before { content: "<table bgcolor=\"#ffffff\" align=\"center\"
border=\"1\" width=\"640\"><tr><td>"; }
body:after { content: "</td></tr></table>"; }

But the tags are just printed as text on my pages. As stated by the CCS2
Specification: "Generated content does not alter the document tree. In
particular, it is not fed back to the document language processor (e.g.,
for reparsing)."

My question is: is there a way to a way do what I want with CSS?

Thanks for your help,
Winston

Well, you don't need to get caught up with the divs vs tables war that is likely
to result from this post!

To do what you want, you need to use either server side includes or a server
side scripting solution such as PHP or ASP.

So to answer your question - no. This is not what CSS is for.

--
Julian Knight, http://www.knightnet.org.uk/
Sheffield, United Kingdom
Security, Directory, Messaging, Network & PC Consultant
Yahoo! IM=knighjm, Skype Internet Phone: callto://j.knight


Reply With Quote
  #4  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: How to frame the body of each page with a table ? - 11-03-2004 , 03:12 PM




"Winston Smith" <winston_smith (AT) linuxmail (DOT) org> wrote

Quote:
Hello,

What I would like to do is to frame the body of every page of my web
site with a table like this:

body bgcolor="#99ccff"
table bgcolor="#ffffff" align="center" border="1" width="640"><tr><td
This is my content...
/td></tr></table
/body
WHY???

You're trying to use CSS for content and HTML for formatting, which is the
ultimate absurdity. If you want a background color and a border and a width,
do it with CSS.

<body>
<div id="content">This is my content.</div>
</body>

CSS:

body { bgcolor: #99ccff; }
div#content { bgcolor: #ffffff; margin-left: auto; margin-right: auto;
border: 1px solid black; width: 640px; padding: 1em; }

Though you should strongly reconsider using a fixed width. Wouldn't you
rather your content fit into the browser regardless of how the user has
sized it? Use width: 50%; or something like that.

Quote:
But I would like to put this once and for all in a single place instead
of editing each of my pages. I thought I could put it in my external CSS
stylesheet with something like:

body:before { content: "<table bgcolor=\"#ffffff\" align=\"center\"
border=\"1\" width=\"640\"><tr><td>"; }
body:after { content: "</td></tr></table>"; }

But the tags are just printed as text on my pages. As stated by the CCS2
Specification: "Generated content does not alter the document tree. In
particular, it is not fed back to the document language processor (e.g.,
for reparsing)."

My question is: is there a way to a way do what I want with CSS?

Thanks for your help,
Winston



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.