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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:09:12+00:00 2026-05-27T09:09:12+00:00

I need to make a slight change to the PHP Excel Reader library; http://code.google.com/p/php-excel-reader/

  • 0

I need to make a slight change to the PHP Excel Reader library; http://code.google.com/p/php-excel-reader/

I want to add support for vertical-alignment of cells (top, middle, bottom).

Here’s how the normal alignment is detected:

                    $alignbit = ord($data[$pos+10]) & 3;

And here is the excel 2003 format specification:

http://sc.openoffice.org/excelfileformat.pdf

I’m not sure if this is the correct setting:

Does anyone know what bit I need to get (similar to the $alignbit) in order to get the vertical alignment? (1 of 6 possibilities)

enter image description here

enter image description here
Thanks,
Wesley

  • 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-27T09:09:13+00:00Added an answer on May 27, 2026 at 9:09 am

    Personally I’d use

    $horizontalAlign = (0x07 & ord($data[$pos+10])) >> 0;
    

    rather than

    $horizontalAlign = ord($data[$pos+10]) & 3;
    

    because you can then match the mask (0x07) up with the spec definition more obviously

    Using the same principle, vertical alignment is bits 6-4, mask 0x70, so

    $verticalAlign = (0x70 & ord($data[$pos+10])) >> 4;
    switch ($verticalAlign) {
        case 0:
            //  VERTICAL_TOP
            break;
        case 1:
            //  VERTICAL_CENTER
            break;
        case 2:
            //  VERTICAL_BOTTOM
            break;
        case 3:
            //  VERTICAL_JUSTIFY
            break;
        case 4:
            //  VERTICAL_DISTRIBUTED
            break;
    }
    

    PS. Why are you still using Open Office’s partial spec, when Microsoft have published the full specification

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

Sidebar

Related Questions

I need to make a piece of C# code interact through COM with all
Here is the application I need help with: http://www.nypinball.com/inventory.php The entire box at the
I need to make a change to an ASP.NET web service written a couple
I have a crystal report file I need make a tiny edit in. It
I need to make a WebCast presentation soon and need to do some whiteboarding
I need to make an application in .NET CF with different/single forms with a
I need to make an ArrayList of ArrayLists thread safe. I also cannot have
I need to make sure that user can run only one instance of my
I need to make some reflective method calls in Java. Those calls will include
We need to make our enterprise ASP.NET/NHibernate browser-based application able to function when connected

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.