Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By cboyd on
I was playing around with this today and got it to work so I thought I'd share. It's basically how to theme the tables module so you get "Ledger-book" like tables displayed. Here is the CSS:
/*
* 'Ledger' style ... this alternates the background color between
* odd and even rows to enhance readibility.
*/
table.tables-ledger {
border-collapse: collapse;
}
table.tables-ledger tr.oddrow td {
background: #D0FFD0; /* This is a faint green */
border: solid black 1px;
border-bottom: 0px;
}
table.tables-ledger tr.evenrow td {
background: #FFFFB0; /* This is a faint yellow */
border: solid black 1px;
border-bottom: 0px;
}
table.tables-ledger tr.firstrow td,
table.tables-ledger tr.firstrow th {
background: #D0FFD0; /* This is a faint green */
border-right: solid black 1px;
border-bottom: solid black 1px;
}
table.tables-ledger tr.firstrow td.firstcol,
table.tables-ledger tr.firstrow th.firstcol {
border-top: 0px;
border-bottom: solid black 1px;
}
table.tables-ledger tr td.firstcol,
table.tables-ledger tr th.firstcol {
border-top: solid black 1px;
border-left: 0px;
font-weight: bold;
}
Then, in your table, just add '=tables-ledger', e.g.:
[tables=tables-ledger !Header1|!Header2|!Header3
ABC|$3.50|Haha]