How to Create Cross-Cell Bar in Excel

How to Create Cross-Cell Bar in Excel

Question:

I want to show the numbers as bar:
Question description
From column D, I want to show the days by bar, each column is a whole day.

Answer:
It’s impossible to show the bars cross different cells, but we can show the bar by merging the cells.
1. Make a copy of the data in column D.
2. Find the maximum and minimum number. The integer of minimum number is the minimum limit (0), and the integer of maximum number plus 1 is the maximum limit (33).
3. Select the data range (from the second row at least, the first row is header row, it’s D2:AK10), select Merge Across, merge the cells.
4. Select the data range, click Conditional Formatting, point to Data Bars, click More rules….
5. Choose Number behind Type, fill in the boxes with minimum and maximum limits in step 1.
6. Check Show bar only, choose a color you like, click OK.
You will see, a bar like below is created.
这里写图片描述
To create a web table like Excel using jSpreadsheet, follow these steps: 1. Add the jspreadsheet script and CSS file to your HTML file. 2. Create a container element for the table in your HTML file. 3. In your script file, create a variable for the data you want to display in the table. This can be done in a variety of ways, such as hard-coding the data or fetching it from an API. 4. Initialize the jSpreadsheet plugin on the container element in your script file. 5. Configure the jSpreadsheet options to match your desired Excel-like behavior, such as allowing sorting and filtering, adding formulas, and formatting cells. 6. Populate the table with data by passing the data variable into the jSpreadsheet `setData` method. 7. (Optional) Add event listeners to the jSpreadsheet instance to handle user interactions with the table, such as clicking a cell or submitting a form. Here's an example code snippet that demonstrates how to create a basic web table using jSpreadsheet: ```html <!-- HTML --> <div id="table-container"></div> ``` ```javascript // JavaScript const data = [ ['Name', 'Age', 'Gender'], ['John', '28', 'M'], ['Jane', '32', 'F'], ['Bob', '45', 'M'], ]; const container = document.getElementById('table-container'); const options = { columnSorting: true, columnDrag: true, filters: true, columnResize: true, rowResize: true, formulas: true, groups: true, mergeCells: true, cellPopup: true, contextMenu: true, }; const jspreadsheet = $(container).jexcel(options); jspreadsheet.setData(data); ``` This code will create a jSpreadsheet instance on the `#table-container` element, with the specified data and options. The resulting table will have Excel-like behavior, such as the ability to sort and filter columns, add formulas, and merge cells.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值