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.

Can you provide custom cell style properties or methods of the first row (header)?

See original GitHub issue

I want to add a cell style to the header. Therefore I had first to Put data, Ignore some fields, and then get Workbook, and then foreach and set the first row of the cell style.

Can you provide this functionality? I believe there are many developers with this kind of demand. Thank you so much.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
donnytiancommented, Nov 23, 2017

I will add below method to mapper, is that fine?

public void ForHeader(Action<ICell> headerAction)

Then you can do below things:

            mapper.ForHeader(cell =>
            {
                if (cell.ColumnIndex == 11)
                {
                    var style = cell.Sheet.Workbook.CreateCellStyle();
                    style.LeftBorderColor = 120;
                    cell.CellStyle = style;
                }
            });
0reactions
VAllenscommented, Nov 24, 2017

Of course, this design is more free and better. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apply, create, or remove a cell style
Create a custom cell style · On the Home tab, in the Styles group, click the More dropdown arrow in the style gallery,...
Read more >
Configuring the cells for your table
With a custom cell, you specify the views you want in the cell, their configurations, and their sizes and positions. Static views such...
Read more >
Table and cell styles in InDesign
When you create a table style, you can specify which cell styles are applied to different regions of the table: header and footer...
Read more >
How To Create a Header Row in Excel Using 3 Methods
1. Highlight the data in your spreadsheet · 2. Choose the "Home" tab and click "Format as Table" · 3. Customize the style...
Read more >
<tr>: The Table Row element - HTML - MDN Web Docs - Mozilla
The HTML element defines a row of cells in a table. The row's cells can then be established using a mix of (data...
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