473,324 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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

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

Jul 21 '05 #1
3 1726
Winston Smith <wi***********@linuxmail.org>:

<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?
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)
Jul 21 '05 #2
From Winston Smith on 03/Nov/2004 19:36:
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
Jul 21 '05 #3

"Winston Smith" <wi***********@linuxmail.org> wrote in message
news:0r********************@charlie.risq.qc.ca...
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.

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


Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paul | last post by:
I have a simple frame-based application where title information appears in a top frame and a lower frame contains the content for the application. One of the needs for this app is for a status...
3
by: D. Alvarado | last post by:
Hello, I am trying to find the <TITLE> element of my document. Normally alert(document.title); works just fine, but when this statement is within a page that is a frame in a larger document,...
7
by: Patrick.O.Ige | last post by:
Can i use Frameset in ASP.NET?What are other options I have a question :- I have an asp.net page and i'm using TreeView control as links The links are on the left side of the page inside a iframe!...
5
by: Martin Chen | last post by:
I have a frame set (as per MS FrontPage 2000). It has a contents and a main frame. The contents frame has a menu bar written with with javascript (in the context of a table). In IE6.1 everything...
0
by: Ian Johnson | last post by:
I am quite new to web development and am struggling with something that seems like it should be fairly simple. I have a page that uses frames. In the left hand frame a menu page is displayed....
2
by: mrjoka | last post by:
hi experts, i'm developing a page in ASP but i'm doing also some javascript insode the page. i'm creating a frame and i want to loop this frame with a duplicateloop function so the form will be...
3
by: rajarya | last post by:
Hi, I m designing a HTML page(index.html),here i have 2 frames,by defult both frames have index1.html and index2.html as their source . in first frame(index.html) ,i have some redio buttons,and a...
4
by: ArrK | last post by:
I want to use a control frame to create and/or modify the content (images and text) of a display frame - all files and images are client side. . When I try to write to the display frame from the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.