question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with set_column actual width different from set width

See original GitHub issue

Hi,

I am using XlsxWriter to do set the width to 8.5 but it appears to set it to 8.57. Setting 8.5x also sets it to 8.57.

I am using Python version 3.7 and XlsxWriter 1.1.6 and Excel version 2013.

Here is some code that demonstrates the problem:

import xlsxwriter

workbook = xlsxwriter.Workbook("x.xlsx")
worksheet = workbook.add_worksheet()
worksheet.set_column('A:AF', 8.50)

workbook.close()

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jmcnamaracommented, Apr 12, 2019

Ok. That is why the column sizes are different and why you can set 8.50 exactly. However, in the Excel default of “Calabri 11” that XlsxWriter supports, it isn’t possible to set a column width of 8.50.

Even in your set up there are probably sizes that you can’t set. For example any of the sizes between 56 and 57 pixels.

0reactions
helixquarcommented, Apr 12, 2019

The size is not the default.

Font: MS Pゴシック Size: 9

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set the table column width constant regardless of the amount ...
Its important to notice this: "The browser will then set column widths based on the width of cells in the first row of...
Read more >
column-width - CSS: Cascading Style Sheets - MDN Web Docs
Indicates the optimal column width. The actual column width may differ from the specified value: it may be wider when necessary to fill ......
Read more >
C# EPPlus column width issue - Microsoft Q&A
C# EPPlus column width issue. I have set column width 0.94 but after excel generation getting lesser width. is it bug? can anyone...
Read more >
Sizing | True DBGrid for WinForms | ComponentOne - GrapeCity
Sizing. In This Topic. Set Column Width; Auto-adjust Column Width; Set Minimum and Maximum Column Width. True DBGrid lets you set the size...
Read more >
Cannot Set Column Width — DataTables forums
I need to set specific columns to specific widths in px. ... scrollCollapse: true, paging: false, info: false, order: [[ 0, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found