Skip to content

Commit b758303

Browse files
authored
Adds whitespace parameter (#44)
* Adds whitespace parameter * Fixes missing brackets
1 parent 013f901 commit b758303

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

components/kern-table/KernTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default function KernTable(props: KernTableProps) {
4747
<tr key={index} className={index % 2 != 0 ? "bg-gray-50" : "bg-white"}>
4848
{row.map((cell, index) => {
4949
return <Fragment key={index}>
50-
<td className="whitespace-nowrap text-center px-3 py-2 text-sm text-gray-500 ">
50+
<td className={"text-center px-3 py-2 text-sm text-gray-500 " + (props.headers[index].wrapWhitespace ? "whitespace-normal" : "whitespace-nowrap")}>
5151
<div className="flex flex-row items-center justify-center gap-x-2">
5252
<ComponentMapper {...cell} />
5353
{cell.editFunction && <IconEdit className="h-5 w-5 text-gray-500 cursor-pointer" onClick={cell.editFunction} />}

types/kern-table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SortKey } from "./sort";
22

33
export type KernTableProps = {
4-
headers: { column: string, id: string, hasSort?: boolean, hasCheckboxes?: boolean, checked?: boolean, onChange?: any, tooltip?: string }[];
4+
headers: { column: string, id: string, hasSort?: boolean, hasCheckboxes?: boolean, checked?: boolean, onChange?: any, tooltip?: string, wrapWhitespace?: boolean }[];
55
values?: any[];
66
config?: {
77
sortKey?: SortKey;

0 commit comments

Comments
 (0)