@@ -8,41 +8,45 @@ export default function Table({
88 headers ?: string [ ] ;
99} ) {
1010 return (
11- < table className = "bg-white dark:bg-slate-900 text-xs text-slate-600 dark:text-slate-300 border-separate border-spacing-0 w-full" >
12- < thead className = "bg-slate-100 dark:bg-slate-800 p-2 rounded text-slate-500" >
13- < tr >
14- { headers . map ( ( header , index ) => (
15- < th
16- key = { `${ index } -${ header } ` }
17- className = { ny ( [
18- `px-3 py-2 text-left font-medium` ,
19- index === 0 && "rounded-tl-lg" ,
20- index === headers . length - 1 && "rounded-tr-lg" ,
21- ] ) }
22- >
23- { header }
24- </ th >
25- ) ) }
26- </ tr >
27- </ thead >
28- < tbody className = "[&>tr:last-child>td:first-child]:rounded-bl-lg [&>tr:last-child>td]:border-b [&>tr:last-child>td:last-child]:rounded-br-lg " >
29- { rows . map ( ( item , index ) => (
30- < tr key = { `${ index } -${ item . prop } ` } >
31- < td className = "px-3 py-2 border font-mono text-xs text-slate-500 border-r-0 border-b-0" >
32- < code className = "border rounded-md p-0.5 bg-slate-100 dark:bg-slate-800 dark:text-slate-400" >
33- { item . prop }
34- </ code >
35- </ td >
36- < td className = "border py-1 px-2 border-r-0 border-b-0" >
37- { item . description }
38- </ td >
39- < td className = "border py-1 px-2 border-r-0 border-b-0" >
40- { item . default }
41- </ td >
42- < td className = "border py-1 px-2 border-b-0 min-w-60" > { item . type } </ td >
11+ < div className = "grid overflow-x-auto" >
12+ < table className = "bg-white dark:bg-slate-900 text-xs text-slate-600 dark:text-slate-300 border-separate border-spacing-0 w-full" >
13+ < thead className = "bg-slate-100 dark:bg-slate-800 p-2 rounded text-slate-500" >
14+ < tr >
15+ { headers . map ( ( header , index ) => (
16+ < th
17+ key = { `${ index } -${ header } ` }
18+ className = { ny ( [
19+ `px-3 py-2 text-left font-medium` ,
20+ index === 0 && "rounded-tl-lg" ,
21+ index === headers . length - 1 && "rounded-tr-lg" ,
22+ ] ) }
23+ >
24+ { header }
25+ </ th >
26+ ) ) }
4327 </ tr >
44- ) ) }
45- </ tbody >
46- </ table >
28+ </ thead >
29+ < tbody className = "[&>tr:last-child>td:first-child]:rounded-bl-lg [&>tr:last-child>td]:border-b [&>tr:last-child>td:last-child]:rounded-br-lg" >
30+ { rows . map ( ( item , index ) => (
31+ < tr key = { `${ index } -${ item . prop } ` } >
32+ < td className = "px-3 py-2 border font-mono text-xs text-slate-500 border-r-0 border-b-0" >
33+ < code className = "border rounded-md p-0.5 bg-slate-100 dark:bg-slate-800 dark:text-slate-400" >
34+ { item . prop }
35+ </ code >
36+ </ td >
37+ < td className = "border py-1 px-2 border-r-0 border-b-0" >
38+ { item . description }
39+ </ td >
40+ < td className = "border py-1 px-2 border-r-0 border-b-0" >
41+ { item . default }
42+ </ td >
43+ < td className = "border py-1 px-2 border-b-0 min-w-60" >
44+ { item . type }
45+ </ td >
46+ </ tr >
47+ ) ) }
48+ </ tbody >
49+ </ table >
50+ </ div >
4751 ) ;
4852}
0 commit comments