Skip to content

Commit

Permalink
Zebra style table.
Browse files Browse the repository at this point in the history
  • Loading branch information
vaijira committed Oct 7, 2024
1 parent f96eb79 commit 314b6dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/css.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 60,11 @@ pub static SECTION_HEADER: Lazy<String> = Lazy::new(|| {
})
}
});

pub static TABLE_ROW: Lazy<String> = Lazy::new(|| {
class! {
.pseudo!(":nth-child(even)", {
.style("background-color", "#f2f2f2")
})
}
});
2 changes: 2 additions & 0 deletions src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 8,7 @@ use futures_signals::{
use web_sys::HtmlElement;

use crate::{
css::TABLE_ROW,
data::Aeat720Record,
utils::{icons::render_svg_delete_square_icon, usize_to_date},
};
Expand Down Expand Up @@ -72,6 73,7 @@ impl Table {
.map_or("".to_string(), |d| d.format("%d/%m/%Y").to_string());

html!("tr", {
.class(&*TABLE_ROW)
.children(&mut [
html!("td", {
.text(&record.company.name)
Expand Down

1 comment on commit 314b6dc

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.