Skip to content

Commit 6ce9ac9

Browse files
authored
fix(table): only apply border to immediate td children (#7911)
* fix(table): only apply border to immediate `td` children Signed-off-by: Aviv Keller <me@aviv.sh> * story * use old name --------- Signed-off-by: Aviv Keller <me@aviv.sh>
1 parent a591c0c commit 6ce9ac9

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

packages/ui-components/__design__/table.stories.tsx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,28 @@ export const Table: StoryObj = {
2525
))}
2626
</tr>
2727
))}
28-
</tbody>
29-
</table>
30-
</main>
31-
),
32-
};
33-
34-
export const HeadlessTable: StoryObj = {
35-
render: () => (
36-
<main>
37-
<table>
38-
<tbody>
39-
{tableData.map((row, rowIndex) => (
40-
<tr key={rowIndex}>
41-
{row.map((cell, cellIndex) => (
42-
<td key={cellIndex}>{cell}</td>
43-
))}
44-
</tr>
45-
))}
28+
<tr>
29+
<td colSpan={3}>
30+
<table>
31+
<thead>
32+
<tr>
33+
<th>Sub 1</th>
34+
<th>Sub 2</th>
35+
</tr>
36+
</thead>
37+
<tbody>
38+
<tr>
39+
<td>Sub A</td>
40+
<td>Sub B</td>
41+
</tr>
42+
<tr>
43+
<td>Sub C</td>
44+
<td>Sub D</td>
45+
</tr>
46+
</tbody>
47+
</table>
48+
</td>
49+
</tr>
4650
</tbody>
4751
</table>
4852
</main>

packages/ui-components/styles/markdown.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ main {
157157
@apply font-semibold;
158158
}
159159

160-
tr:last-child td {
160+
tr:last-child > td {
161161
@apply sm:border-b-0;
162162

163163
&:last-child {

0 commit comments

Comments
 (0)