Patchwork NAND table: alternate row colors

login
register
mail settings
Submitter Artem Bityutskiy
Date March 4, 2013, 11:03 a.m.
Message ID <1362395027-6513-1-git-send-email-dedekind1@gmail.com>
Download mbox | patch
Permalink /patch/224689/
State Accepted
Commit ac4ce425feb80ca9a40598b5c7b0a96c0fb97009
Headers show

Comments

Artem Bityutskiy - March 4, 2013, 11:03 a.m.
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

The truly great NAND table that we have is rather difficult to follow because
it is big. Make this a bit easier by applying different background colors to
different rows. Alternate the colors with period = 4.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 nand-data/csvtohtml.py | 2 +-
 nand-data/header.tmpl  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
Brian Norris - March 4, 2013, 8:17 p.m.
On Mon, Mar 4, 2013 at 3:03 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
>
> The truly great NAND table that we have is rather difficult to follow because
> it is big. Make this a bit easier by applying different background colors to
> different rows. Alternate the colors with period = 4.
>
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

Thanks, I agree that it can be difficult to follow as-is. I primarily
deal with it using spreadsheet software, so I have helpful aids there
:)

Your color scheme can clash a bit with foreground blue/red text (for
"unsupported" chips), but hey, I'm not a web designer, and I think
this is an improvement.

Acked-by: Brian Norris <computersforpeace@gmail.com>

Patch

diff --git a/nand-data/csvtohtml.py b/nand-data/csvtohtml.py
index 06b010b..36c72aa 100755
--- a/nand-data/csvtohtml.py
+++ b/nand-data/csvtohtml.py
@@ -21,7 +21,7 @@  def csvToHTML(file):
 	tmp = open(head, 'r')
 	fdout.write(tmp.read())
 	tmp.close()
-	fdout.write('<table>\n')
+	fdout.write('<table class="zebra">\n')
 	row = reader.next()
 	for i in range(len(row)):
 		if (row[i] == "All but Size"):
diff --git a/nand-data/header.tmpl b/nand-data/header.tmpl
index d0b3423..a9d5420 100644
--- a/nand-data/header.tmpl
+++ b/nand-data/header.tmpl
@@ -22,6 +22,9 @@ 
 	table th { background-color: #eee; }
 	.wrong-size { color: #0066FF; }
 	.exception { color: red; }
+	.zebra tbody tr:nth-child(4n+1) { background-color: #ffffef;}
+	.zebra tbody tr:nth-child(4n+2) { background-color: #ffefff;}
+	.zebra tbody tr:nth-child(4n+3) { background-color: #efffff;}
 	#footer { text-align: left; }
 </style>
 <!--