473,405 Members | 2,176 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,405 software developers and data experts.

Emulate paging in an HTML document.

I want to emulate paging in an HTML document. something like,

-------------------------
| |
| <DIV> |
| |
| <TABLE></TABLE> |
| |
| <TABLE></TABLE> |
| |
| </DIV> |
| |
| <DIV PAGEBREAK> |
| |
| <DIV> |
| |
| <TABLE></TABLE> |
| |
| <TABLE></TABLE> |
| |
| </DIV> |
| |
| |
| |

The DIVs( <DIV STYLE="width:'100%';position:relative;"> ) are
positioned relative to the body, and the TABLEs ( <TABLE
STYLE="width:'80%';position:absolute;left:'0PX';to p:'0PX';"> ) are
positioned absolute to the DIVs.

Thus, when I print preview the document, I get two tables in each
page; however, in the display, the tables that are supposed to be in
the second page page overlap the ones that are in the first page. I
guess the reason is 'cos the DIVs' height will not consist of the sum
of the height of the child <TABLE> elements that are in it. ( I put a
border around the DIV and confirmed this. It takes only one
glyph/px/whatever.. )

Is it possible to acheive what I want to?? I dont know...

I would greatly appreciate any help.
Regards,
Rithish.
Jul 20 '05 #1
10 13648
Rithish wrote:
Is it possible to acheive what I want to?? I dont know...


Isn't there a CSS thing to force page breaks?

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Jul 20 '05 #2
On 11 May 2004 07:32:09 -0700, Rithish <ri*****@dacafe.com> wrote:
I want to emulate paging in an HTML document.
To me, this is sort of like emulating sore, tired legs and feet in an
automobile, but I'll play ball.
The DIVs( <DIV STYLE="width:'100%';position:relative;"> ) are
positioned relative to the body, and the TABLEs ( <TABLE
STYLE="width:'80%';position:absolute;left:'0PX';to p:'0PX';"> ) are
positioned absolute to the DIVs.

Thus, when I print preview the document, I get two tables in each
page; however, in the display, the tables that are supposed to be in
the second page page overlap the ones that are in the first page. I
guess the reason is 'cos the DIVs' height will not consist of the sum
of the height of the child <TABLE> elements that are in it. ( I put a
border around the DIV and confirmed this. It takes only one
glyph/px/whatever.. )


What your issue is, I'm not entirely sure. Have you read
http://www.w3.org/TR/CSS2/page.html#page-breaks ? If so, is your issue
that the page break is not working? I don't know much about this aspect of
CSS, perhaps there are support issues.

Is your div containing the tables as you desire, or not? I'm really not
clear on that.

Please create a live example and post a URL so what you're asking can be
more lucent.
Jul 20 '05 #3
On Tue, 11 May 2004, John Bokma wrote:
Isn't there a CSS thing to force
CSS never "forces" anything. It only makes proposals, which the
client agent can action or not as it sees fit. That's an important
principle, not just a form of words.
page breaks?


Not those either.
Jul 20 '05 #4
John Bokma wrote:
Isn't there a CSS thing to force page breaks?


[bearing in mind A.Flavell's comments about "force" and css]

AFAIK, css pagination support is extremely poor. I think only Opera has
made even an attempt to support it, and it has not succeeded. You might
learn more by Googling for Mozilla css @page and Opera css @page. (Don't
bother with MSIE!)

--
Brian (remove "invalid" from my address to email me)
http://www.tsmchughs.com/
Jul 20 '05 #5
Brian wrote:
John Bokma wrote:
Isn't there a CSS thing to force page breaks?


[bearing in mind A.Flavell's comments about "force" and css]


Indeed, should have written "suggest" or "kindly request" not force.

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Jul 20 '05 #6
Brian wrote:
John Bokma wrote:
Isn't there a CSS thing to force page breaks?

[bearing in mind A.Flavell's comments about "force" and css]

AFAIK, css pagination support is extremely poor. I think only Opera has
made even an attempt to support it, and it has not succeeded. You might
learn more by Googling for Mozilla css @page and Opera css @page. (Don't
bother with MSIE!)


<div style="page-break-before: always;"> seems to work in Mozilla.

= Eric

Jul 20 '05 #7
On Tue, 11 May 2004, Alan J. Flavell wrote:
CSS never "forces" anything. It only makes proposals, which the
client agent can action or not as it sees fit. That's an important
principle, not just a form of words.
page breaks?


Not those either.


My apologies: I hadn't meant to be so brusque at the end. But as
others have already noted, browser support for this is still quite
poor, and I can't offer you anything more positive, I'm afraid.
Jul 20 '05 #8
> What your issue is, I'm not entirely sure.

Pardon me for not stating my issue clearly... I am yet a novice.. :D
My issue is not breaking of pages... CSS style 'Page-break' works
fine. The issue is the display of these elements as contiguous.

Is your div containing the tables as you desire, or not? I'm really not
clear on that.

Please create a live example and post a URL so what you're asking can be
more lucent.


I am sorry that I will be unable to post a URL... However, I will try
to explain with an example...

I will take a scenario wherein I want to have two tables in two pages
of the document. The first table/s will be 48px from the top of the
page, and the second would be 96px from the top of the page. Hence, if
I do a print of the document, I will effectively get two pages, with
two tables each in them, like this,

Page 1
--------------------
| |
| <Table at 48px> |
| |
| |
| <Table at 96px> |
| |
--------------------

Page 2
--------------------
| |
| <Table at 48px> |
| |
| |
| <Table at 96px> |
| |
--------------------

However, when the html document is viewed(display), the tables overlap
each other.. I mean, the tables of the second page, write over the
tables in the first page. I know this is 'cos of the CSS absolute
positioning of elements.
I believed the DIV to bloat up to accomodate the TABLEs specified in
it. Hence, when the next DIV is relatively positioned to the previous,
four tables could be viewed, one below the other... This is my
requirement...

The code snippet for this is as below,

<DIV STYLE="width:'100%';position:relative;BORDER-TOP:'1PX SOLID
BLUE';BORDER-LEFT:'1PX SOLID BLUE';BORDER-RIGHT:'1PX SOLID
BLUE';BORDER-BOTTOM:'1PX SOLID BLUE';">

<TABLE HEIGHT="48PX" STYLE="width:'80%';BORDER-TOP:'1PX SOLID
BLACK';BORDER-LEFT:'1PX SOLID BLACK';BORDER-RIGHT:'1PX SOLID
BLACK';BORDER-BOTTOM:'1PX SOLID
BLACK';position:absolute;left:'0PX';top:'0PX';">
<TR>
<TD ALIGN=CENTER VALIGN=MIDDLE>Test1</TD>
</TR>
</TABLE>

<TABLE HEIGHT="48PX" STYLE="width:'60%';BORDER-TOP:'1PX SOLID
BLACK';BORDER-LEFT:'1PX SOLID BLACK';BORDER-RIGHT:'1PX SOLID
BLACK';BORDER-BOTTOM:'1PX SOLID
BLACK';position:absolute;left:'0PX';top:'96PX';">
<TR>
<TD ALIGN=CENTER VALIGN=MIDDLE>Test2</TD>
</TR>
</TABLE>

</DIV>
<DIV STYLE="PAGE-BREAK-AFTER:always;position:relative;"></DIV>
<DIV STYLE="width:'100%';position:relative; BORDER-TOP:1PX SOLID RED;
BORDER-LEFT:1PX SOLID RED; BORDER-RIGHT:1PX SOLID RED;
BORDER-BOTTOM:1PX SOLID RED;">

<TABLE HEIGHT="48PX" STYLE="width:'80%';BORDER-TOP:'1PX SOLID
BLACK';BORDER-LEFT:'1PX SOLID BLACK';BORDER-RIGHT:'1PX SOLID
BLACK';BORDER-BOTTOM:'1PX SOLID
BLACK';position:absolute;left:'0PX';top:'0PX';">
<TR>
<TD ALIGN=CENTER VALIGN=MIDDLE>Test3</TD>
</TR>
</TABLE>

<TABLE HEIGHT="48PX" STYLE="width:'60%';BORDER-TOP:'1PX SOLID
BLACK';BORDER-LEFT:'1PX SOLID BLACK';BORDER-RIGHT:'1PX SOLID
BLACK';BORDER-BOTTOM:'1PX SOLID
BLACK';position:absolute;left:'0PX';top:'96PX';">
<TR>
<TD ALIGN=CENTER VALIGN=MIDDLE>Test4</TD>
</TR>
</TABLE>

</DIV>

You will note that the tables are encompassed and absolutely
positioned inside and wrt a DIV. Thus each DIV would emulate a page...

This is the best my vocabulary can do... I hope I have stated my
point.. I greatly appreciate your help folks...

Regards,
Rithish.
Jul 20 '05 #9
ri*****@dacafe.com (Rithish) wrote:
My issue is not breaking of pages... CSS style 'Page-break' works
fine. The issue is the display of these elements as contiguous. I will take a scenario wherein I want to have two tables in two pages
of the document. The first table/s will be 48px from the top of the
page, and the second would be 96px from the top of the page. Hence, if
I do a print of the document, I will effectively get two pages, with
two tables each in them, like this,

Page 1
--------------------
| |
| <Table at 48px> |
| |
| |
| <Table at 96px> |
| |
--------------------

Page 2
--------------------
| |
| <Table at 48px> |
| |
| |
| <Table at 96px> |
| |
--------------------

However, when the html document is viewed(display), the tables overlap
each other.. I mean, the tables of the second page, write over the
tables in the first page. I know this is 'cos of the CSS absolute
positioning of elements.
You're obviously trying to achieve something a bit trickier than this
though, or you wouldn't need positioning at all.

I believed the DIV to bloat up to accomodate the TABLEs specified in
it. Hence, when the next DIV is relatively positioned to the previous,
four tables could be viewed, one below the other... This is my
requirement.


To get what you're describing, just leave all the positioning out,
except the page-break between table 2 and table 3. So what are you
really after?
Jul 20 '05 #10
wo****************@yahoo.com.au (Wolfgang Wildeblood) wrote in message news:<a9**************************@posting.google. com>...

You're obviously trying to achieve something a bit trickier than this
though, or you wouldn't need positioning at all.


You are right, Wolf... :D What I want to achieve is a bit more
trickier... However, I did not want to burden you all, with more of my
problems..

After some more browsing, I managed to hit upon an article which might
suit my purpose.. So I got to work on it, and lo !!! eureka !!!! ;D

The HTML document is structured as such.

<BODY>

<DIV> <!-- this denotes the beginning of the page -->

<DIV> <!-- this denotes the beginning of a table -->
<TABLE></TABLE>
</DIV> <!-- this denotes the end of the table -->

<DIV> <!-- this denotes the beginning of a table -->
<TABLE></TABLE>
</DIV> <!-- this denotes the end of the table -->

<!-- and as many more tables in a page -->

</DIV> <!-- this denotes the end of the page -->

<!-- and as many more pages in a document with a page break
inbetween -->

</BODY>

There are a few specific rules that I had noticed.
1. If a DIV contains elements inside it, which are relatively
positioned, then the DIV itself bloats up to accomodate these inner
elements.

2. If the inner elements of a DIV are absolutely positioned, then the
DIV does not expand to fill in the elements, but takes a width of 1
glyph.

3. If no positional attributes are specified for the inner elements of
a DIV, then the elements take their natural flow.

In order to simulate a paging display, I have structured the html as
such.
The table DIV is positioned relative to the page DIV, and the TABLE is
positioned absolute to the table DIV. ( refer diagram above )
The positioning of the table is obtained by specification of the STYLE
'margin-left' and 'margin-top' attributes of the table DIV.
Hence, rule 1 is satisfied, and the page DIV expands to accomodate its
inner table DIVs. The tables are positioned by specifying the
'margin-left' and 'margin-top' rather than the 'top' and 'left' style
attributes of the table DIV.
An example is as below.

<HTML>
<HEAD>
<TITLE></TITLE>
<BODY topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0 >
<DIV STYLE="height:'1038.5115px';width:'769.695px';BORD ER-TOP:'1PX
SOLID BLUE';BORDER-LEFT:'1PX SOLID BLUE';BORDER-RIGHT:'1PX SOLID
BLUE';BORDER-BOTTOM:'1PX SOLID BLUE';">

<DIV STYLE="Position:'relative';margin-left:'76.9695px';margin-top:'48px';">

<TABLE ALIGN="CENTER" HEIGHT="48px" WIDTH="615.756px" STYLE="
POSITION:'absolute'; BORDER-TOP:'1PX SOLID BLACK'; BORDER-LEFT:'1PX
SOLID BLACK'; BORDER-RIGHT:'1PX SOLID BLACK'; BORDER-BOTTOM:'1PX SOLID
BLACK';">
<TR>
<TD ALIGN=CENTER VALIGN=MIDDLE>Test</TD>
</TR>
</TABLE>

</DIV>

</DIV>
<DIV STYLE="PAGE-BREAK-AFTER:always" ></DIV>
<DIV STYLE="height:'1038.5115px';width:'769.695px';BORD ER-TOP:'1PX
SOLID BLUE';BORDER-LEFT:'1PX SOLID BLUE';BORDER-RIGHT:'1PX SOLID
BLUE';BORDER-BOTTOM:'1PX SOLID BLUE';">

<DIV STYLE="Position:'relative';margin-left:'76.9695px';margin-top:'48px';">

<TABLE ALIGN="CENTER" HEIGHT="48px" WIDTH="615.756px" STYLE="
POSITION:'absolute'; BORDER-TOP:'1PX SOLID BLACK'; BORDER-LEFT:'1PX
SOLID BLACK'; BORDER-RIGHT:'1PX SOLID BLACK'; BORDER-BOTTOM:'1PX SOLID
BLACK';">
<TR>
<TD ALIGN=CENTER VALIGN=MIDDLE>Test</TD>
</TR>
</TABLE>

</DIV>

</DIV>
</BODY>
</HTML>
A big thanks to all of you people out there, who have heeded my
request, or atleast gave it some thought.

Regards,
Rithish.
Jul 20 '05 #11

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

Similar topics

1
by: RelaxoRy | last post by:
Reposted (not sure if got sent) I have results being displayed each with its own checkbox name "selected" and value "id". When someone checks a checkbox, and then continues to page through...
7
by: R0bert Nev1lle | last post by:
Internet Explorer always presents me with a challenge (partial repost). The current issue involves emulating max-width in IE using the technique described by Svend Tofte. ...
0
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update...
2
by: bulk88 | last post by:
How can I emulate DOM level 1 removeChild in IE 4? I already figured out to emulate getElementById by doing this if((!document.getElementById) && document.all) {document.getElementById =...
1
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and...
0
by: dnphamus13 | last post by:
I'm new to this and drowning right now. I would like to put my database online for viewing. I managed to do the filtering but i need to do PAGING as the XML doc get bigger. From what i understand...
2
by: farhad13841384 | last post by:
Hi , I Hope You fine. I have some problem with this code for paging in asp.net this bottom code work correctly without any error but when I try to place separate code in .VB file then error is...
2
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.