
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
I couldn't find a gem that would allow an HTML preview of a styled Excel spreadsheet before exporting, so I had to roll my own. Styles can be applied to individual cells, entire rows, or (once the table is built) even columns. To save some bandwidth, styles are applied using automatically-defined classes which are then applied to the corresponding cells.
Add this line to your application's Gemfile:
gem 'table_setting'
And then execute:
$ bundle
Or install it yourself as:
$ gem install table_setting
The following simple example creates a table which has a header featuring large white text on a dark brown background. The bottom right cell is individually set to bold text and the bottom row spans all columns. Exporting with to_html or to_xls achieve roughly the same formatting.
sheet = TableSetting::Sheet.new
header = sheet.new_row(background: '#3A2212', color: '#ffffff', bold: true, size: '18px')
header.add_cells(["First Name", "Last Name"])
sheet.new_row.add_cells(["Fred", "Flintstone"])
row = sheet.new_row
row.new_cell("Wilma")
row.new_cell("Flintstone", bold: true)
footer = sheet.new_row
footer.new_cell("That is all the people to list.", span: 'all')
Then export:
sheet.to_html
sheet.to_xls
sheet.to_csv
Or maybe you want to turn the whole second column red:
sheet.style_column(2, background: '#ff6666')
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that table_setting demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.