feat: add table support
This commit is contained in:
parent
2418a617e0
commit
9cdb051157
4 changed files with 80 additions and 3 deletions
40
index.html
40
index.html
|
@ -83,7 +83,7 @@
|
||||||
<form action="#">
|
<form action="#">
|
||||||
<input type="submit" value="Submit">
|
<input type="submit" value="Submit">
|
||||||
</form>
|
</form>
|
||||||
<table border="1" cellspacing="0" cellpadding="5">
|
<table class="centered">
|
||||||
<tr>
|
<tr>
|
||||||
<td>Row 1, Column 1</td>
|
<td>Row 1, Column 1</td>
|
||||||
<td>Row 1, Column 2</td>
|
<td>Row 1, Column 2</td>
|
||||||
|
@ -95,6 +95,44 @@
|
||||||
<td>Row 2, Column 3</td>
|
<td>Row 2, Column 3</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
<table border="1" cellspacing="0" cellpadding="5">
|
||||||
|
<tr>
|
||||||
|
<th>Row 1, Column 1</th>
|
||||||
|
<th>Row 1, Column 2</th>
|
||||||
|
<th>Row 1, Column 3</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Row 1, Column 1</td>
|
||||||
|
<td>Row 1, Column 2</td>
|
||||||
|
<td>Row 1, Column 3</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Row 2, Column 1</td>
|
||||||
|
<td>Row 2, Column 2</td>
|
||||||
|
<td>Row 2, Column 3</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Row 1, Column 1</th>
|
||||||
|
<th>Row 1, Column 2</th>
|
||||||
|
<th>Row 1, Column 3</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>Row 1, Column 1</td>
|
||||||
|
<td>Row 1, Column 2</td>
|
||||||
|
<td>Row 1, Column 3</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Row 2, Column 1</td>
|
||||||
|
<td>Row 2, Column 2</td>
|
||||||
|
<td>Row 2, Column 3</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
<img src="https://via.placeholder.com/800x600/" alt="">
|
<img src="https://via.placeholder.com/800x600/" alt="">
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="menu">
|
<ul class="menu">
|
||||||
|
|
|
@ -6,7 +6,8 @@ h4,
|
||||||
h5,
|
h5,
|
||||||
h6,
|
h6,
|
||||||
ul,
|
ul,
|
||||||
ol {
|
ol,
|
||||||
|
table {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0 0 1rem 0;
|
margin: 0 0 1rem 0;
|
||||||
}
|
}
|
||||||
|
|
37
src/components/_tables.scss
Normal file
37
src/components/_tables.scss
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
table {
|
||||||
|
border-collapse: separate;
|
||||||
|
width:100%;
|
||||||
|
border:0;
|
||||||
|
border-spacing: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.centered th, table.centered td {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr, th, td {
|
||||||
|
border:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
th, td {
|
||||||
|
background-color: var(--color-background-alt);
|
||||||
|
padding:.33rem .66rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
table:not(:has(thead)) tr:first-child, table > tr:first-child, table thead tr:first-child {
|
||||||
|
td:first-child, th:first-child {
|
||||||
|
border-top-left-radius: var(--well-radius);
|
||||||
|
}
|
||||||
|
td:last-child, th:last-child {
|
||||||
|
border-top-right-radius: var(--well-radius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
table > tr:last-child, table tbody tr:last-child {
|
||||||
|
td:first-child, th:first-child {
|
||||||
|
border-bottom-left-radius: var(--well-radius);
|
||||||
|
}
|
||||||
|
td:last-child, th:last-child {
|
||||||
|
border-bottom-right-radius: var(--well-radius);
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,4 +27,5 @@
|
||||||
@import 'components/cards';
|
@import 'components/cards';
|
||||||
@import 'components/well';
|
@import 'components/well';
|
||||||
@import 'components/buttons';
|
@import 'components/buttons';
|
||||||
@import 'components/menus';
|
@import 'components/menus';
|
||||||
|
@import 'components/tables';
|
Loading…
Add table
Reference in a new issue