Skip to content

Commit

Permalink
feat: setColumnWidth 메서드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sasha1107 committed Feb 17, 2024
1 parent 7c31394 commit 998a6a0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# excel-build

![npm](https://img.shields.io/npm/dt/excel-build)
[![npm](https://img.shields.io/npm/dt/excel-build)](https://npmtrends.com/excel-build)
[![npm](https://img.shields.io/npm/v/excel-build)](https://www.npmjs.com/package/excel-build)
<a href="https://excel-build.vercel.app/en/docs" target="_blank">
<a href="https://excel-build.vercel.app/en" target="_blank">
<img height="20px" src="https://img.shields.io/badge/📚-%20Docs-%23000000"/>
</a>

Expand Down Expand Up @@ -59,6 +59,7 @@ const sheet2 = new SheetBuilder('sheet_2')
| `mergeCell` | Merge the cells with the starting cell [x0, y0] and the ending cell [x1, y1] as factors. | `function` | `(start: [number, number], end: [number, number])` | `SheetBuilder` |
| `getWorkSheet` | Returns the sheet you created. | `function` | `-` | `SheetBuilder` |
| `getSheetName` | Returns the name of the sheet you created. | `function` | `-` | `string` |
| `setColumnWidth` | Set the width for a specific column on the sheet. | `function` | `(columnNumber: number, width: number)` | `SheetBuilder` |

## CellBuilder

Expand Down
30 changes: 30 additions & 0 deletions docs/src/app/[lng]/docs/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Code } from 'bright';
import { useTranslation } from '@/app/i18n';
import { HashLink, Sider } from '../_components';
import Link from 'next/link';

export default async function Home({
params: { lng },
}: {
Expand Down Expand Up @@ -62,6 +64,17 @@ sheet1.appendCustomRow(
<div className=''>
<HashLink lng={lng} id='installation' level={2} text='설치' />
<div className='ml-2'>
<div className='my-2 mt-4'>
<Link
href={'https://www.npmjs.com/package/excel-build'}
target='_blank'
>
<img
src='https://img.shields.io/npm/v/excel-build'
alt='npm version'
/>
</Link>
</div>
<Code lang='bash' className='text-sm'>
npm install excel-build
</Code>
Expand Down Expand Up @@ -255,6 +268,23 @@ sheet1.appendCustomRow(
<code className='inline'>string</code>
</td>
</tr>
<tr>
<td>
<code className='inline'>setColumnWidth</code>
</td>
<td>{t('시트의 특정 열에 대한 넓이를 설정합니다.')}</td>
<td>
<code className='inline'>function</code>
</td>
<td>
<code className='inline'>
(columnNumber: number, width: number)
</code>
</td>
<td>
<code className='inline'>SheetBuilder</code>
</td>
</tr>
</tbody>
</table>
</div>
Expand Down
3 changes: 2 additions & 1 deletion docs/src/app/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@
"셀을 빌드합니다.": "Build a cell.",
"문서": "DOCS",
"예제": "Example",
"다운로드 버튼을 클릭하여 다운로드된 엑셀 파일을 확인해보세요.": "Click the download button to check the downloaded Excel file."
"다운로드 버튼을 클릭하여 다운로드된 엑셀 파일을 확인해보세요.": "Click the download button to check the downloaded Excel file.",
"시트의 특정 열에 대한 넓이를 설정합니다.": "Set the width for a specific column on the sheet."
}
1 change: 1 addition & 0 deletions packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const sheet2 = new SheetBuilder('sheet_2')
| `mergeCell` | Merge the cells with the starting cell [x0, y0] and the ending cell [x1, y1] as factors. | `function` | `(start: [number, number], end: [number, number])` | `SheetBuilder` |
| `getWorkSheet` | Returns the sheet you created. | `function` | `-` | `SheetBuilder` |
| `getSheetName` | Returns the name of the sheet you created. | `function` | `-` | `string` |
| `setColumnWidth` | Set the width for a specific column on the sheet. | `function` | `(columnNumber: number, width: number)` | `SheetBuilder` |

## CellBuilder

Expand Down
2 changes: 1 addition & 1 deletion packages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "excel-build",
"version": "1.0.27",
"version": "1.1.1",
"description": "excel-build is a library for creating excel files in the browser",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 998a6a0

Please sign in to comment.