Skip to content

Instantly share code, notes, and snippets.

@librasteve
Last active December 27, 2024 14:40
Show Gist options
  • Save librasteve/b3e03cbeabdd36edcfcef297127d92ee to your computer and use it in GitHub Desktop.
Save librasteve/b3e03cbeabdd36edcfcef297127d92ee to your computer and use it in GitHub Desktop.
BaseLib.rakumod - table
use HTML::Functional; # :CRO exclusions not needed here
my @components = <Results ActiveTable Table Grid>;
#warn self.thead.raku; $*ERR.flush;
role THead {
has @.thead;
method thead( --> Str() ) {
thead do for @!thead -> $cell {
th $cell
}
}
}
#| https://picocss.com/docs/table TODO
class Table does THead {
has @.data;
multi method new(@data, *%h) {
$.new: :@data, |%h
}
method render {
table :border<1>, [
self.thead;
tbody do for @!data -> @row {
tr do for @row -> $cell {
td $cell
}
}
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment