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 6985803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:43:38+00:00 2026-05-27T18:43:38+00:00

I am using DOMpdf to create pdf files. To print the following table I

  • 0

I am using DOMpdf to create pdf files. To print the following table I have to get it as a variable and then send it to my controller. just like $value = "Some value(in this place I want the following table) "; But here in this case I am not sure how get this entire table inside a variable when you have some PHP script to populate data.

Please help.

   <?php if(count($records) > 0) { ?>
            <h1> Batch Name: <?php echo "$batchname";?> </h1>
            <table id="table1" class="gtable sortable">
            <thead>
                    <tr>
                        <th>S.N</th>
                        <th>Student ID</th>
                        <th>Exam Date</th>
                        <th>Exam Type</th>
                        <th>Subject</th>
                        <th>Total Mark</th>
                        <th>Highest Mark</th>
                        <th>Obtained Mark</th>
                        <th>GPA</th>
                        <th>Grade</th>
                        <th>Status</th>

                    </tr>
            </thead>
            <tbody>
             <?php $i = $this->uri->segment(3) + 0; foreach ($records as $row){ $i++; ?>


                    <tr>
                        <td><?php echo $i; ?>.</td>

                        <td><a href="<?php echo base_url(); ?>viewbatch/get/<?php echo $row['studentid']; ?>"><?php echo $row['studentid'];?></a></td>
                        <td><?php echo $row['examdate'];?></td>
                        <td><?php echo $row['examtype'];?></td>

                        <td><?php echo $row['subject'];?></td>
                        <td><?php echo $row['totalmark'];?></td>

                        <td><?php echo $row['highestmark'];?></td>
                        <td><?php echo $row['obtainedmark'];?></td>

                        <td><?php echo $row['gradepoint'];?></td>
                        <td><?php echo $row['grade'];?></td>
                        <td><?php echo $row['status'];?></td>



                    </tr>
            <?php  } ?>

            </tbody>
            </table>
  • 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-27T18:43:39+00:00Added an answer on May 27, 2026 at 6:43 pm

    Try this code.

    <?php
    ob_start(); 
    if(count($records) > 0) { ?>
                <h1> Batch Name: <?php echo "$batchname";?> </h1>
                <table id="table1" class="gtable sortable">
                <thead>
                        <tr>
                            <th>S.N</th>
                            <th>Student ID</th>
                            <th>Exam Date</th>
                            <th>Exam Type</th>
                            <th>Subject</th>
                            <th>Total Mark</th>
                            <th>Highest Mark</th>
                            <th>Obtained Mark</th>
                            <th>GPA</th>
                            <th>Grade</th>
                            <th>Status</th>
    
                        </tr>
                </thead>
                <tbody>
                 <?php $i = $this->uri->segment(3) + 0; foreach ($records as $row){ $i++; ?>
    
    
                        <tr>
                            <td><?php echo $i; ?>.</td>
    
                            <td><a href="<?php echo base_url(); ?>viewbatch/get/<?php echo $row['studentid']; ?>"><?php echo $row['studentid'];?></a></td>
                            <td><?php echo $row['examdate'];?></td>
                            <td><?php echo $row['examtype'];?></td>
    
                            <td><?php echo $row['subject'];?></td>
                            <td><?php echo $row['totalmark'];?></td>
    
                            <td><?php echo $row['highestmark'];?></td>
                            <td><?php echo $row['obtainedmark'];?></td>
    
                            <td><?php echo $row['gradepoint'];?></td>
                            <td><?php echo $row['grade'];?></td>
                            <td><?php echo $row['status'];?></td>
    
    
    
                        </tr>
                <?php  } ?>
    
                </tbody>
                </table>
    <?php
    $output = ob_get_clean();
     ?>
    

    Cheers!

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

Sidebar

Related Questions

I am trying to generate pdf using Dompdf. I have the following script for
I am using the DOMPDF library to create an invoice in PDF. This document
i'm using dompdf library to render some html content into pdf files. I actually
I have a method that returns a PDF file using DOMPDF . It sends
I'm using the dompdf HTML to PDF converter to dynamically generate PDF files based
Im using DOMPDF to create a certificate so people can print it. Problem is
hi i am trying to create a pdf files in php useing dompdf-0.5.1 i
I am trying to create PDF file using DOM pdf and Codeigniter. I have
I followed this tutorial: https://github.com/EllisLab/CodeIgniter/wiki/PDF-generation-using-dompdf However, I can't seem to set the path right.
Using jQuery, how do I get the value from a textbox and then load

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.