Post by metro on Sept 19, 2015 18:34:20 GMT -5
I need some help to get my head around this,
I want to implement alternate background colors in a table. I have found this..
HERE:http://www.w3schools.com/html/html_tables.asp
but I'm unsure how to code it in RB. I'm using this table
Also , am I correct in assuming background colors at a "cell" level over ride "row" level CSS
appreciate any assistance
Laurie
I want to implement alternate background colors in a table. I have found this..
table#t01 tr:nth-child(even) {
background-color: #eee;
}
table#t01 tr:nth-child(odd) {
background-color: #fff;
}
table#t01 th {
color: white;
background-color: black;
}
HERE:http://www.w3schools.com/html/html_tables.asp
but I'm unsure how to code it in RB. I'm using this table
html "</div><div>"
dim person$(1,3)
person$(0,1) = "Carl Gundel"
person$(0,2) = "Janet Terra"
person$(0,3) = "Stefan Pendl"
person$(1,1) = "USA"
person$(1,2) = "USA"
person$(1,3) = "Austria"
table #ta, person$()
'Add a caption above the table
#ta caption("Run BASIC Community")
'add column names - one for each of the second dimensions
'in the array, beginning with 0
#ta columnnames("Name, Country")
'create a caption class with cssclass
cssclass "caption.a", "{ Background-Color: #C0C0C0; font: caption }"
'use caption.a class for this table caption
#ta captionclass("a")
'create a table class with cssclass
cssclass "table.mytable", "{ width: 300px; border: 4px ridge #CCF ; border-spacing: 3px; row: Background-Color #C0C0C0 }"
'use table.mytable class for this table
#ta cssclass("mytable")
'create a table row class with cssclass
cssclass "tr.rowclass", "{ Background-Color: #666666 }"
'create a cell class (table data) with cssclass
cssclass "td.cellclass", "{ Background-Color: #FFDDBB}" '#FFDDBB
'use td.cellclass for this table
#ta tdclass("cellclass")
'row class is used where thclass and tdclass are not set
'use tr.rowclass for this table
#ta trclass("rowclass")
'create a header class with cssclass
cssclass "th.header", "{ Background-Color: #FFEEDD }"
'use th.header class for this table
#ta thclass("header")
'if allclass is used, it supercedes other class assignments
'cssclass ".all", "{ Background-Color: #AAFFEE }"
'#ta allclass("all")
'cause the first column of names to become links
'the handler name must be in quotation marks
#ta link("Name","addGuy")
render #ta
wait
sub addGuy key$
print "You clicked: ";key$
person$(0,0) = "Rod Bird"
person$(1,0) = "Scotland"
end sub
Also , am I correct in assuming background colors at a "cell" level over ride "row" level CSS
appreciate any assistance
Laurie