Remove CSS handling from Table

Drop the loadCSS method and its constructor call. Styling is now the
consumer's responsibility via the emitted class names, keeping the
class self-contained and free of app-specific asset paths.
This commit is contained in:
CentreMetre
2026-06-14 18:06:44 +01:00
parent d7c2851008
commit 8d8107ec49

View File

@@ -38,8 +38,6 @@ export abstract class Table<TRow extends Object> {
this.table.appendChild(this.tableBody);
this.loadCSS()
this.messageEl = messageElement === undefined ? document.createElement("p") : messageElement;
}
@@ -83,19 +81,6 @@ export abstract class Table<TRow extends Object> {
this.table.appendChild(thead);
}
/**
* Loads the CSS for tables into the html file for custom styling.
* @param relativePathAndName The path to go to for the cess file, including the filename and extension.
*/
loadCSS(relativePathAndName: string) {
const link = document.createElement("link");
link.rel = "stylesheet"
link.href = relativePathAndName;
link.type = 'text/css';
document.head.appendChild(link);
}
/**
* Returns the table element of this instance for putting onto a page.
*/