summaryrefslogtreecommitdiffstats
path: root/grid/src
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2020-11-17 22:22:26 +0100
committerivarlovlie <git@ivarlovlie.no>2020-11-17 22:22:26 +0100
commit90dee7245e89de3f8cf60d816e976781fd9425d9 (patch)
tree95d7c8dc3d2b307e9a2434935815b6b991711e43 /grid/src
parent6faf447ab9d6b15b4a4eb6aac716fc512c34cfe3 (diff)
downloadweb-components-90dee7245e89de3f8cf60d816e976781fd9425d9.tar.xz
web-components-90dee7245e89de3f8cf60d816e976781fd9425d9.zip
responsive by default
Diffstat (limited to 'grid/src')
-rw-r--r--grid/src/grid.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/grid/src/grid.ts b/grid/src/grid.ts
index f263ac7..374f6ca 100644
--- a/grid/src/grid.ts
+++ b/grid/src/grid.ts
@@ -7,7 +7,7 @@ interface GridProps {
columns: Array<GridColumn>;
pageSize?: number;
search?: SearchConfiguration;
- tableClassName?: string
+ tableClassName?: string;
}
interface GridConfiguration {
@@ -17,7 +17,7 @@ interface GridConfiguration {
columns: Array<GridColumn>;
pageSize: number;
search: SearchConfiguration;
- tableClassName: string
+ tableClassName: string;
}
interface SearchConfiguration {
@@ -136,12 +136,15 @@ export default class Grid {
}
private renderWrapper(): void {
- const wrapper = document.createElement("table");
+ const wrapper = document.createElement("div");
+ wrapper.className = "table-responsive";
+ const table = document.createElement("table");
const thead = document.createElement("thead");
const tbody = document.createElement("tbody");
- wrapper.className = this.configuration.tableClassName;
- wrapper.appendChild(thead);
- wrapper.appendChild(tbody);
+ table.className = this.configuration.tableClassName;
+ table.appendChild(thead);
+ table.appendChild(tbody);
+ wrapper.appendChild(table);
this.domElement.appendChild(wrapper);
}