Skip to content

Commit 286725e

Browse files
committed
fix table width
1 parent 0417ecd commit 286725e

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

docs/snippets/CurrentPricesTable.jsx

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -319,44 +319,50 @@ export const CurrentPricesTable = () => {
319319
<table
320320
style={{
321321
width: '100%',
322+
maxWidth: '100%',
322323
borderCollapse: 'collapse',
323324
marginBottom: '30px',
325+
tableLayout: 'auto',
324326
}}
325327
>
326328
<thead>
327329
<tr style={{ backgroundColor: '#f5f5f5' }}>
328330
<th
329331
style={{
330-
padding: '12px',
332+
padding: '8px 10px',
331333
textAlign: 'left',
332334
border: '1px solid #ddd',
335+
fontSize: '0.9em',
333336
}}
334337
>
335338
Product
336339
</th>
337340
<th
338341
style={{
339-
padding: '12px',
342+
padding: '8px 10px',
340343
textAlign: 'right',
341344
border: '1px solid #ddd',
345+
fontSize: '0.9em',
342346
}}
343347
>
344348
Base Price
345349
</th>
346350
<th
347351
style={{
348-
padding: '12px',
352+
padding: '8px 10px',
349353
textAlign: 'right',
350354
border: '1px solid #ddd',
355+
fontSize: '0.9em',
351356
}}
352357
>
353358
Max Price
354359
</th>
355360
<th
356361
style={{
357-
padding: '12px',
362+
padding: '8px 10px',
358363
textAlign: 'right',
359364
border: '1px solid #ddd',
365+
fontSize: '0.9em',
360366
}}
361367
>
362368
Current Price
@@ -382,40 +388,44 @@ export const CurrentPricesTable = () => {
382388
<tr key={productId}>
383389
<td
384390
style={{
385-
padding: '12px',
391+
padding: '8px 10px',
386392
border: '1px solid #ddd',
387393
fontWeight: '500',
394+
fontSize: '0.9em',
388395
}}
389396
>
390397
{PRODUCT_NAMES[productId]}
391398
</td>
392399
<td
393400
style={{
394-
padding: '12px',
401+
padding: '8px 10px',
395402
textAlign: 'right',
396403
border: '1px solid #ddd',
397404
fontFamily: 'monospace',
405+
fontSize: '0.85em',
398406
}}
399407
>
400408
{formatPrice(basePriceInTokens, basePriceInUSD)}
401409
</td>
402410
<td
403411
style={{
404-
padding: '12px',
412+
padding: '8px 10px',
405413
textAlign: 'right',
406414
border: '1px solid #ddd',
407415
fontFamily: 'monospace',
416+
fontSize: '0.85em',
408417
}}
409418
>
410419
{formatPrice(maxPriceInTokens, maxPriceInUSD)}
411420
</td>
412421
<td
413422
style={{
414-
padding: '12px',
423+
padding: '8px 10px',
415424
textAlign: 'right',
416425
border: '1px solid #ddd',
417426
fontFamily: 'monospace',
418427
fontWeight: '600',
428+
fontSize: '0.85em',
419429
}}
420430
>
421431
{formatPrice(currentPriceInTokens, currentPriceInUSD)}
@@ -434,25 +444,29 @@ export const CurrentPricesTable = () => {
434444
<table
435445
style={{
436446
width: '100%',
447+
maxWidth: '100%',
437448
borderCollapse: 'collapse',
449+
tableLayout: 'auto',
438450
}}
439451
>
440452
<thead>
441453
<tr style={{ backgroundColor: '#f5f5f5' }}>
442454
<th
443455
style={{
444-
padding: '12px',
456+
padding: '8px 10px',
445457
textAlign: 'left',
446458
border: '1px solid #ddd',
459+
fontSize: '0.9em',
447460
}}
448461
>
449462
Component
450463
</th>
451464
<th
452465
style={{
453-
padding: '12px',
466+
padding: '8px 10px',
454467
textAlign: 'right',
455468
border: '1px solid #ddd',
469+
fontSize: '0.9em',
456470
}}
457471
>
458472
Price
@@ -477,8 +491,9 @@ export const CurrentPricesTable = () => {
477491
<tr key={index}>
478492
<td
479493
style={{
480-
padding: '12px',
494+
padding: '8px 10px',
481495
border: '1px solid #ddd',
496+
fontSize: '0.9em',
482497
}}
483498
>
484499
{componentName}
@@ -490,10 +505,11 @@ export const CurrentPricesTable = () => {
490505
</td>
491506
<td
492507
style={{
493-
padding: '12px',
508+
padding: '8px 10px',
494509
textAlign: 'right',
495510
border: '1px solid #ddd',
496511
fontFamily: 'monospace',
512+
fontSize: '0.85em',
497513
}}
498514
>
499515
{formatPrice(priceInTokens, priceInUSD)}

0 commit comments

Comments
 (0)