You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exporting a DataFrame styled with "vertical-align: middle" does not produce expected output with xlsxwriter engine.
With openpyxl (expected behavior):
With xlsxwriter:
The error arises from xlsxwriter expects the vertical align property to be "vcenter", while openpyxl expects "center". The _xlsxwriter._XlsxStyler should translate "center" to "vcenter" for the valign property.
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Exporting a DataFrame styled with
"vertical-align: middle"
does not produce expected output with xlsxwriter engine.With openpyxl (expected behavior):

With xlsxwriter:

The error arises from
xlsxwriter
expects the vertical align property to be"vcenter"
, whileopenpyxl
expects"center"
. The_xlsxwriter._XlsxStyler
should translate"center"
to"vcenter"
for thevalign
property.Expected Behavior
Installed Versions
INSTALLED VERSIONS
commit : 06d2301
python : 3.10.1.final.0
python-bits : 64
OS : Windows
OS-release : 10
...
pandas : 1.4.1
numpy : 1.22.0
pytz : 2021.3
dateutil : 2.8.2
pip : 22.0.3
setuptools : 60.2.0
Cython : None
pytest : 7.0.1
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.0.2
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.3
IPython : 8.0.0
pandas_datareader: None
bs4 : None
bottleneck : 1.3.2
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.5.1
numba : None
numexpr : 2.8.0
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.7.3
sqlalchemy : None
tables : 3.6.1
tabulate : None
xarray : None
xlrd : 2.0.1
xlwt : None
zstandard : None
The text was updated successfully, but these errors were encountered: