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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:38:33+00:00 2026-06-05T18:38:33+00:00

Is it possible to apply a heading style (especially heading 3 as in excel

  • 0

Is it possible to apply a heading style (especially heading 3 as in excel 2007) and total style (as in excel 2007) in a cell in Excel 2007 using PHPExcel as shown in the following snippet?

enter image description here

I applied these styles after generating it (as can be seen in the Shipping Address, Billing Address and Total cells). Tried on Google for a long time but couldn’t find it therefore, I presumably believed that they might not be supported by PHPExcel. Is there a way to do so using PHPExcel?

  • 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-06-05T18:38:35+00:00Added an answer on June 5, 2026 at 6:38 pm

    Excel’s “Predefined styles” aren’t built into PHPExcel, although it wouldn’t be too difficult to emulate.

    You can define a style array to replicate any of Excel’s predefined styles, and then use the applyFromArray() method to set a cell to that style.

    $totalStyle = array(
        'borders' => array(
            'outline' => array(
                'style' => PHPExcel_Style_Border::BORDER_THIN,
                'color' => array('argb' => 'FF000000'),
            ),
        ),
    );
    $objPHPExcel->getActiveSheet()->getStyle('A4:C4')->applyFromArray($totalStyle);
    

    All you need to do is work out the individual components of each pre-defined Excel style, and define the style array accordingly.

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

Sidebar

Related Questions

Is it possible to apply a style to an HTML element using only its
Normally it is possible to apply data validation in excel through vba but i
Is it possible to apply a css(3) style to a label of a checked
Is it possible to apply (and remove) Windows group policy settings using .NET? I
Is it possible to apply style attribute or class to link in textile? I've
Is it possible to apply style to all class X only if it's of
Is it possible to apply / create a YUI Button by using an element's
Is it possible to apply the OpenStack using 3 machines doc, to One Node
Is it possible to apply a style to the outer div in this example,
Is it possible to apply one CSS declaration to more than one HTML element

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.