2022.2

Table Of Contents
:nth-child(odd)matcheschildelements1,3,5,7,etc.Thekeywordodd substitutestheexpres-
sion2n+1,whichinotherwordssays:'takeeverysecondelement,startingat1'.
:nth-child(even)matcheschildelements2,4,6,8,etc.Thekeywordeven substitutestheexpres-
sion2n+0,orsimply2n.
:nth-child(3n)matcheschildelements3,6,9,12etc.
:nth-child(3n+1)matcheschildelements1,4,7,10etc.,soeverythirdelement,startingat1.
Viascript(basedonadatafieldvalue)
Tostyleatable,roworcellbasedonadatafieldvalue,youhavetowriteascript(see"Writingyourown
scripts"onpage368).
FirstaddanIDorclasstothetable,roworcellthatneedstobestyled:selecttheelement(see"Select-
ingatable,roworcell"onpage278)andaddanIDontheAttributespane.Thencreateascript,using
thatIDorclassasthescript'sselector.Thescriptcanbeverysimple:
if (record.fields.COUNTRY == 'CANADA') {
results.css('color','green');
}
TheDesignerScriptsAPIprovidesseveralfunctionstostyleelements,forexamplecss(),hasClass
()andaddClass()(see"StandardScriptAPI"onpage715).
ForinformationregardingscriptsforDynamic Tables,see"UsingscriptsinDynamicTables"on
page395.
Styling an image
Justlikemanyotherelements,imagescanbegivenbordersandroundedcorners,andtheycanbe
rotated.Howtodothisisn'tanydifferentfromthewayitisdonewithotherelements,soitisn't
describedinthistopic,butingeneralformattingtopics;see"Stylingandformatting"onpage260.
Thistopicdiscussesspecificimageformattingissues.
NotethatimagecharacteristicslikebrightnessandcontrastcannotbechangedwithintheDesigner.
Localformattingvs.stylesheets
Justasotherelements,imagescanbestyledintwoways:
l
Withlocal formatting.Thismeansstylingtheimagedirectly,usingtheFormattingdialog.
l
ViaCascading Style Sheets(CSS).Inastylesheet,stylerulesaredeclaredforelementswith
differentHTMLtags,ID'sandclasses.
See"Stylingandformatting"onpage260forbackgroundinformationaboutthesetwomethods.
Page 281