Last active
December 27, 2024 14:40
-
-
Save librasteve/b3e03cbeabdd36edcfcef297127d92ee to your computer and use it in GitHub Desktop.
BaseLib.rakumod - table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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