Browse Source

Tentando Colorir tabela

master
Henrique Caetano de Barros 3 years ago
parent
commit
7fedfda182
1 changed files with 8 additions and 5 deletions
  1. +8
    -5
      server/services/index.js

+ 8
- 5
server/services/index.js View File

@ -1,4 +1,7 @@
const cinza = '#eee'
const branco = '#fff'
const dbRecords = _db.query(` const dbRecords = _db.query(`
SELECT evento.titulo, evento.data, evento.capacidade, SELECT evento.titulo, evento.data, evento.capacidade,
@ -22,11 +25,11 @@ _out.println('<div style="display: flex; justify-content: center; margin-top: 80
for (let i = 0; i < dbRecords.length; i++) { for (let i = 0; i < dbRecords.length; i++) {
_out.println('<tr style="height: 35px;">') _out.println('<tr style="height: 35px;">')
_out.println(`<td sytle="color: ${i % 2 == 0 ? "#eee" : "#fff"}">${dbRecords[i].getString("titulo")}</td>`)
_out.println(`<td sytle="color: ${i % 2 == 0 ? "#eee" : "#fff"}">${dbRecords[i].getString("data")}</td>`)
_out.println(`<td sytle="color: ${i % 2 == 0 ? "#eee" : "#fff"}">${dbRecords[i].getInt("capacidade")}</td>`)
_out.println(`<td sytle="color: ${i % 2 == 0 ? "#eee" : "#fff"}">${dbRecords[i].getDouble("preco")}</td>`)
_out.println(`<td sytle="color: ${i % 2 == 0 ? "#eee" : "#fff"}">${dbRecords[i].getString("categoria")}</td>`)
_out.println(`<td sytle="color: ${i % 2 == 0 ? cinza : branco}">${dbRecords[i].getString("titulo")}</td>`)
_out.println(`<td sytle="color: ${i % 2 == 0 ? cinza : branco}">${dbRecords[i].getString("data")}</td>`)
_out.println(`<td sytle="color: ${i % 2 == 0 ? cinza : branco}">${dbRecords[i].getInt("capacidade")}</td>`)
_out.println(`<td sytle="color: ${i % 2 == 0 ? cinza : branco}">${dbRecords[i].getDouble("preco")}</td>`)
_out.println(`<td sytle="color: ${i % 2 == 0 ? cinza : branco}">${dbRecords[i].getString("categoria")}</td>`)
_out.println('</tr>') _out.println('</tr>')
} }


Loading…
Cancel
Save