Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5997537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:16:40+00:00 2026-05-23T00:16:40+00:00

I have converted HTML to DOC format using PHP. kindly view the below screen

  • 0

I have converted HTML to DOC format using PHP.

kindly view the below screen shot.

enter image description here

My Problem is i need to print 1st table in first page and 2nd table in second page.

Here is my set of code.

header("Content-type: application/vnd.ms-word");
header("Content-Disposition: attachment;Filename=document_name.doc");
echo $html = '<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML TO WORD</title>
</head>
<style type="text/css">
.table {
 page-break-after: always;
}
</style>
<body>
<table width="600" border="1">
<tr>
<td height="105">&nbsp;</td>
</tr>
<tr>
<td style="text-align:center; font-size:30px;color:#ed6500;"><b>Title</b></td>
</tr>
<tr>
<td style="text-align:center; color:#595959;">Author:
<span style="color:#9d402b; text-decoration:underline;">Author name</span></td>
</tr>
</table>
<table width="600" border="1">
<tr>
<td>Table Of Contents</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>Category 1</td>
</tr>
<tr>
<td style="padding-left:30px;">Sub Category 1</td>
</tr>
</table>
</body>
</html>';

How can this be done?

Thanks in advance…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:16:41+00:00Added an answer on May 23, 2026 at 12:16 am

    put this where you need a page break:

    <br clear="all" style="page-break-before:always" />
    

    this is working for me

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am designing reports using freemarker, I have a problem where I need the
We have to convert EVERYTHING to images for archiving purpose. DOC, HTML, email, ZIP,
I have a list of values such as 12000,12345,123456 that need to be converted
I have the following as3 function below which converts normal html with links so
I'm having difficulty with building a HTML email. I currently have converted my entire
I have converted my classic asp.net mvc views to razor. In a view there
I am using Twig and this date filter http://www.twig-project.org/doc/templates.html#date Apparently they are looking out
I have been trying to convert doc/docx files to html, the best bet I
Hi I have webpage data (html converted into xml) consisting of many forms ,
I have this HTML structure and want to convert it to an accordion. <div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.