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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:26:48+00:00 2026-05-25T19:26:48+00:00

I have a ColdFusion page with a styled HTML table in it. What I

  • 0

I have a ColdFusion page with a styled HTML table in it. What I would like to be able to do is set up a feature that allows our customers to save the table as an image file, for use in their slide shows. I have read some of the documentation for cfcontent however, I am beginning to get the feeling that I will need a third party library. I was hoping someone could shed some light on this.

  • 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-25T19:26:49+00:00Added an answer on May 25, 2026 at 7:26 pm

    You could render your html table to a static page, then call http://code.google.com/p/wkhtmltopdf/ using cfexecute to render to pdf, or wkhtmltoimage can convert to .png .gif etc

    Here’s a static page with a test table and some css table.cfm

    <html>
    <head>
        <title>Table test</title>
    
    </head>
    <style>
     *{
         margin:0;
         padding:0;
     }
     body{
         font-family: Georgia, serif;
         font-size: 20px;
         font-style: italic;
         font-weight: normal;
         letter-spacing: normal;
     }
     #content{
         padding:40px;
         margin:0 auto;
         -moz-box-shadow:0px 0px 16px #aaa;
     }
    
    /* Table 1 Style */
    table.table1{
        font-family: "Trebuchet MS", sans-serif;
        font-size: 16px;
        font-weight: bold;
        line-height: 1.4em;
        font-style: normal;
        border-collapse:separate;
    }
    .table1 thead th{
        padding:15px;
        color:#fff;
        text-shadow:1px 1px 1px #568F23;
        border:1px solid #93CE37;
        border-bottom:3px solid #9ED929;
        background-color:#9DD929;
        background:-webkit-gradient(
            linear,
            left bottom,
            left top,
            color-stop(0.02, rgb(123,192,67)),
            color-stop(0.51, rgb(139,198,66)),
            color-stop(0.87, rgb(158,217,41))
            );
        background: -moz-linear-gradient(
            center bottom,
            rgb(123,192,67) 2%,
            rgb(139,198,66) 51%,
            rgb(158,217,41) 87%
            );
        -webkit-border-top-left-radius:5px;
        -webkit-border-top-right-radius:5px;
        -moz-border-radius:5px 5px 0px 0px;
        border-top-left-radius:5px;
        border-top-right-radius:5px;
    }
    .table1 thead th:empty{
        background:transparent;
        border:none;
    }
    .table1 tbody th{
        color:#fff;
        text-shadow:1px 1px 1px #568F23;
        background-color:#9DD929;
        border:1px solid #93CE37;
        border-right:3px solid #9ED929;
        padding:0px 10px;
        background:-webkit-gradient(
            linear,
            left bottom,
            right top,
            color-stop(0.02, rgb(158,217,41)),
            color-stop(0.51, rgb(139,198,66)),
            color-stop(0.87, rgb(123,192,67))
            );
        background: -moz-linear-gradient(
            left bottom,
            rgb(158,217,41) 2%,
            rgb(139,198,66) 51%,
            rgb(123,192,67) 87%
            );
        -moz-border-radius:5px 0px 0px 5px;
        -webkit-border-top-left-radius:5px;
        -webkit-border-bottom-left-radius:5px;
        border-top-left-radius:5px;
        border-bottom-left-radius:5px;
    }
    .table1 tfoot td{
        color: #9CD009;
        font-size:32px;
        text-align:center;
        padding:10px 0px;
        text-shadow:1px 1px 1px #444;
    }
    .table1 tfoot th{
        color:#666;
    }
    .table1 tbody td{
        padding:10px;
        text-align:center;
        background-color:#DEF3CA;
        border: 2px solid #E7EFE0;
        -moz-border-radius:2px;
        -webkit-border-radius:2px;
        border-radius:2px;
        color:#666;
        text-shadow:1px 1px 1px #fff;
    }
        </style>
    <body>
    <div id="content">
    
    <table  class="table1">
    <thead>
    <tr>
        <th>column 1</th>
        <th>column 2</th>
        <th>column 3</th>
    </tr>
    </thead>
    <tbody>
    <tr>
        <td>1</td>
        <td>2</td>
        <td>3</td>
    </tr>
    
    <tr>
        <td>oranges</td>
        <td>lemons</td>
        <td>apples</td>
    </tr>
    </tbody>
    <tfoot>
    <tr>
        <td>red</td>
        <td>blue</td>
        <td>green</td>
    </tr>
    
    </tfoot>
    </table>
    
    </div>
    
    </body>
    </html>
    

    Make a simple batch file wkhtmltoimage.bat

    f:\temp\wkhtmltoimage --crop-h 250 --crop-w 200 http://localhost:8500/table.cfm f:\temp\outputfile.png 
    

    More command line options here

    Use cfexecute to run the batch file

    <cfexecute name="F:\temp\wkhtmltoimage.bat" timeout="20" variable="result"> 
    </cfexecute> 
    

    Output is pretty nice

    enter image description here

    The windows installer libwkhtmltox-0.10.0_rc2.zip contains topdf and wkhtmltoimage

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

Sidebar

Related Questions

I have a servlet that I would like to run within ColdFusion MX 7.
As an experiment I'd like to set up a coldfusion page that will pull
We have a simple ColdFusion page that is outputting basic HTML to the browser.
I have set up my coldfusion application to have dynamic urls on the page,
I have a web page in ColdFusion which shows contents from a SQL table.
I have a URL that goes to a pdf file. In my coldfusion page,
I have created a complex sql server 2008/coldfusion search page, that searches thru a
I have an ASP.Net HTTPHandler that gets POSTed from a ColdFusion web page whose
I have made this nice little table: testPage.cfm: <html> <head> <title>Test Page</title> <style> .blue{
I have a coldfusion page that uses JQuery UI TAB to load another coldfufion

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.