Print Page | Close Window

Printed a formatted page

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=11644
Printed Date: 01 April 2026 at 5:44am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Printed a formatted page
Posted By: simflex
Subject: Printed a formatted page
Date Posted: 27 August 2004 at 11:30am

Dear experts,
I am trying to format a page so that when a user prints a document, the layout will be exactly as the one shown on the link below:

http://www.websamba.com/afparishioners/certific.pdf - http://www.websamba.com/afparishioners/certific.pdf

It is formatted on an 8/11 paper.

The text may change but the length of each text is generally the same.

Any help would be greatly, greatly appreciated.




Replies:
Posted By: dpyers
Date Posted: 27 August 2004 at 12:30pm
Use CSS or tables. Shouldn't be a problem. What problems are you having formating it as an html page?

-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: simflex
Date Posted: 27 August 2004 at 1:36pm

Thanks DP for the response.

 

It is not getting aligned correctly when using tables:

Here is what I tried to do and as you can see from this code,

It isn't lining up correctly compared with what I have on the net.

 

<HTML>
<HEAD>
<TITLE>Beanie</TITLE>
<link href="styles.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY>
<LEFT>
  <TABLE BORDER='0' BGCOLOR='white' WIDTH='36%'>
    <TR>
     <TD ALIGN='LEFT' WIDTH="27%">
      <TABLE>
        <TR>
         <TD ALIGN='LEFT'><B>6/15/2004</B></TD>
        </TR> </TABLE></TD><TD WIDTH="68%">
      <TABLE ALIGN="CENTER">
        <TR>
         <TD ALIGN='R'><B>051704</B></TD>
        </TR> </TABLE></TD></TR>
    <TR>
     <TD ALIGN='CENTER' COLSPAN='2'>
      <TABLE border="0">
       <TR>
        <TD COLSPAN='2' ALIGN='CENTER'>&nbsp;</TD>
       </TR>
       <TR>
        <TD COLSPAN='2 ALIGN='LEFT''></TD>
       </TR>
     </TABLE>
    </TD>
   </TR>
   <TR>
    <TD ALIGN='CENTER' COLSPAN='2'>
     <TABLE border="0">
      <TR>
       <TD COLSPAN='2' ALIGN='CENTER'>&nbsp;</TD>
      </TR>
      <TR>
       <TD COLSPAN='2 ALIGN='LEFT''></TD>
      </TR>
    </TABLE>
   </TD>
  </TR>
  <TR>
   <TD ALIGN='CENTER' COLSPAN='2'>
    <TABLE>
     <TR>
      <TD COLSPAN='2' ALIGN='CENTER'><B>Joseph Peace</B></TD>
     </TR>
     <TR>
      <TD COLSPAN='2 ALIGN='LEFT''></TD>
     </TR>
    </TABLE>
   </TD>
  </TR>
  <TR>
    <TD ALIGN='LEFT' WIDTH="27%">
     <TABLE >
      <TR>
       <TD ALIGN='LEFT'><B>5th</B></TD>
      </TR>
     </TABLE>
    </TD>
    <TD WIDTH="68%">
    <TABLE ALIGN="LEFT" WIDTH="144">
     <TR>
      <TD ALIGN='LEFT' HEIGHT="20"><B>#4053</B></TD>
      <TD ALIGN='RIGHT' HEIGHT="20"><B>6th/Can</B></TD>
     </TR>
    </TABLE>
   </TD>
   <TD WIDTH="5%"></TD>
  </TR>
  <TR>
   <TD ALIGN='CENTER' COLSPAN='2'>
    <TABLE>
     <TR>
      <TD COLSPAN='2' ALIGN='CENTER'><B>MWMT-Musuem Quality!<br>Beautiful Beanie! Pretty Colors!</B></TD>
     </TR>
     <TR>
      <TD COLSPAN='2 ALIGN='LEFT''></TD>
     </TR>
    </TABLE>
   </TD>
  </TR>
  <TR>
   <TD ALIGN='CENTER' COLSPAN='2'>
    <TABLE>
     <TR>
      <TD COLSPAN='2' ALIGN='LEFT'><B>051704</B></TD>
     </TR>
     <TR>
      <TD COLSPAN='2 ALIGN='LEFT''></TD>
     </TR> </TABLE>
    </TD>
   </TR>
  </TABLE>
 </LEFT>
</BODY>
</HTML>

 

 

 



Posted By: dpyers
Date Posted: 27 August 2004 at 2:44pm

<LEFT> and </LEFT> are not valid tags. Try relacing those tags and everything between them with

<div align="left" style="margin-left: 5%;">
 <table style="font-weight: bold;" border="0" cellpadding="0" style="border-collapse: collapse" width="33%" id="table1">
  <tr>
   <td align="left" colspan="2">6/15/2004</td>
   <td align="right" colspan="2">051704</td>
  </tr>
  <tr>
   <td colspan="4">&nbsp;</td>
  </tr>
  <tr>
   <td colspan="4">&nbsp;</td>
  </tr>
  <tr>
   <td colspan="4" align="center">Joseph Peace</td>
  </tr>
  <tr>
   <td colspan="4" align="center">&nbsp;</td>
  </tr>
  <tr>
   <td align="left" width="33">5th</td>
   <td align="center" width="34%" colspan="2">#4053</td>
   <td align="right" width="33%">6th/Can</td>
  </tr>
  <tr>
   <td colspan="4" align="center">&nbsp;</td>
  </tr>
  <tr>
   <td colspan="4" align="center">MWMT-Musuem Quality!<br>Beautiful Beanie! Pretty Colors!</td>
  </tr>
  <tr>
   <td colspan="4">&nbsp;</td>
  </tr>
  <tr>
   <td colspan="4" style="font-family: 'Courier New', 'Courier',  'serif'; font-size:200%; font-weight: normal;">051704</td>
  </tr>
 </table>
</div>

EDIT: - post updated for closing DIV tag and to add a couple of blamk rows...



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: simflex
Date Posted: 27 August 2004 at 3:04pm

This is perfect!

Thanks a million!!!



Posted By: simflex
Date Posted: 27 August 2004 at 4:10pm

This looks really great, thank you again.


Can ask you just one more question about this, please?

 

All the info on this form are getting picked up from the database.

I have modified what you gave me to accommodate that.

So, so far, so good except one thing.

There is one problem, however.

The information on this tag:

 <tr>
   <td colspan="4" align="center">MWMT-Musuem Quality!<br>Beautiful Beanie! Pretty Colors!</td>
  </tr>

as you can see is broken up into two separate lines but there is just one field for it.

Is there a way to break them in such that a portion of the code like

MWMT-Musuem Quality! will be on one line and
Beautiful Beanie! Pretty Colors will be on another line just like we have them now?

 



Posted By: dpyers
Date Posted: 27 August 2004 at 5:02pm

The only reliable way to have them split where you want them to would be to store the <br> characters as part of the db field.

If the data is inputted via a form, you'd replace all occurrences of the constant vbCRLF with "<br>" within your form handler script - e.g.

strDataField = replace(strDataField,vbCRLF, "<br>")

If you don't want to do that and don't care precisely where the line breaks, you can use the Split command to split the string at evey space. This will create an array of words. You'd response.write the first half of the array with a space between each word. Response.write the <br>. Then do the second half of the array.

Another way would be to calculate the midpoint of the string and then look for the first space after that and replace it with a <br>. e.g.

intMidPoint = Round(Len(strDataField) / 2)
strDataField = Replace(strDataField, " ", "<br>", intMidPoint, 1)

NOTE: - the ,1 in the replace statement specifies the number of times to do the replace.

 



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: simflex
Date Posted: 27 August 2004 at 10:58pm

This is great, really great stuff.

Thanks one million and one times




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net