html/css - complex Screenshot of a complex example when showing all the rows: Wanting to use a potion I first filter for the item type being Potion : Then I filter for potions that are on my Character : Here is the html code for the example: < div class = "equipment-list" > < input type = "radio" hidden name = "attr_equipment_type_filter" class = "equipment-all" value = "All types" checked /> < input type = "radio" hidden name = "attr_equipment_type_filter" class = "equipment-clothes" value = "Clothes" /> < input type = "radio" hidden name = "attr_equipment_type_filter" class = "equipment-potions" value = "Potions" /> < input type = "radio" hidden name = "attr_equipment_type_filter" class = "equipment-other" value = "Other" /> < input type = "radio" hidden name = "attr_equipment_location_filter" class = "location-all" value = "All locations" checked /> < input type = "radio" hidden name = "attr_equipment_location_filter" class = "location-character" value = "Character" /> < input type = "radio" hidden name = "attr_equipment_location_filter" class = "location-other" value = "Other" /> < div class = "equipment header row" > < div class = "equipment header field" >Equipment</ div > < div class = "equipment header field" >Description</ div > < select class = "equipment header field select" name = "attr_equipment_type_filter" > < option >All types</ option > < option >Clothes</ option > < option >Potions</ option > < option >Other</ option > </ select > < select class = "equipment header field select" name = "attr_equipment_location_filter" > < option >All locations</ option > < option >Character</ option > < option >Other</ option > </ select > </ div > < fieldset class = "repeating_equipment" > < input type = "radio" hidden name = "attr_equipment_type" class = "equipment-all" value = "All types" checked /> < input type = "radio" hidden name = "attr_equipment_type" class = "equipment-clothes" value = "Clothes" /> < input type = "radio" hidden name = "attr_equipment_type" class = "equipment-potions" value = "Potions" /> < input type = "radio" hidden name = "attr_equipment_type" class = "equipment-other" value = "Other" /> < input type = "radio" hidden name = "attr_equipment_location" class = "location-all" value = "All locations" checked /> < input type = "radio" hidden name = "attr_equipment_location" class = "location-character" value = "Character" /> < input type = "radio" hidden name = "attr_equipment_location" class = "location-other" value = "Other" /> < div class = "equipment data row" > < input class = "equipment data field" type = "text" name = "attr_equipment_item" value = "" /> < input class = "equipment data field" type = "text" name = "attr_equipment_desc" value = "" /> < select class = "equipment data field select" name = "attr_equipment_type" > < option >All types</ option > < option >Clothes</ option > < option >Potions</ option > < option >Other</ option > </ select > < select class = "equipment data field select" name = "attr_equipment_location" > < option >All locations</ option > < option >Character</ option > < option >Other</ option > </ select > </ div > </ fieldset > </ div > Here is the css code for the example: /*============================== = = = Some other styling = = = ==============================*/ .charsheet { --background-row : #cccccc ; --background-header : #999999 ; --height-header-select : 1.38 em ; --inter-row-space : 3 px ; } .sheet-field { background-color : var(--background-row) ; width : 100 % ; padding : 0 px ; } .sheet-select { margin-bottom : 0 px ; } .sheet-header.sheet-field { background-color : var(--background-header) ; } .sheet-header.sheet-select { height : var(--height-header-select) ; } .sheet-data.sheet-row { background-color : var(--background-row) ; } .sheet-equipment.sheet-row { display : grid ; grid-template-columns : 1 fr 1 fr 6 em 8 em ; margin-bottom : var(--inter-row-space) ; } /*============================== = = = Relevant section = = = ==============================*/ /* Rows are hidden by default */ .sheet-data.sheet-row { display : none ; } /* All rows marked with 'All types' or 'All locations' should always display */ .repitem input .sheet-equipment-all:checked ~ .sheet-data.sheet-row , .repitem input .sheet-location-all:checked ~ .sheet-data.sheet-row , /* When 'All types' and 'All locations' are selected in the header, show all rows When 'All types' is selected in the header, and character or other is selected as location, then show rows with matching location */ input .sheet-equipment-all:checked ~ input .sheet-location-all:checked ~ .repcontainer .sheet-data.sheet-row , input .sheet-equipment-all:checked ~ input .sheet-location-character:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-location-character:checked ~ .sheet-data.sheet-row , input .sheet-equipment-all:checked ~ input .sheet-location-other:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-location-other:checked ~ .sheet-data.sheet-row , /* When 'Clothes' and 'All locations' are selected in the header, show all rows marked with 'Clothes' as Type When 'Clothes' is selected in the header, and character or other is selected as location, then show rows with a matching set of values*/ input .sheet-equipment-clothes:checked ~ input .sheet-location-all:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-equipment-clothes:checked ~ .sheet-data.sheet-row , input .sheet-equipment-clothes:checked ~ input .sheet-location-character:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-equipment-clothes:checked ~ input .sheet-location-character:checked ~ .sheet-data.sheet-row , input .sheet-equipment-clothes:checked ~ input .sheet-location-other:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-equipment-clothes:checked ~ input .sheet-location-other:checked ~ .sheet-data.sheet-row , /* When 'Potions' and 'All locations' are selected in the header, show all rows marked with 'Potions' as Type When 'Potions' is selected in the header, and character or other is selected as location, then show rows with a matching set of values*/ input .sheet-equipment-potions:checked ~ input .sheet-location-all:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-equipment-potions:checked ~ .sheet-data.sheet-row , input .sheet-equipment-potions:checked ~ input .sheet-location-character:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-equipment-potions:checked ~ input .sheet-location-character:checked ~ .sheet-data.sheet-row , input .sheet-equipment-potions:checked ~ input .sheet-location-other:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-equipment-potions:checked ~ input .sheet-location-other:checked ~ .sheet-data.sheet-row , /* When 'Other' and 'All locations' are selected in the header, show all rows marked with 'Other' as Type When 'Other' is selected in the header, and character or other is selected as location, then show rows with matching pairs of values*/ input .sheet-equipment-other:checked ~ input .sheet-location-all:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-equipment-other:checked ~ .sheet-data.sheet-row , input .sheet-equipment-other:checked ~ input .sheet-location-character:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-equipment-other:checked ~ input .sheet-location-character:checked ~ .sheet-data.sheet-row , input .sheet-equipment-other:checked ~ input .sheet-location-other:checked ~ fieldset .repeating_equipment + .repcontainer > .repitem input .sheet-equipment-other:checked ~ input .sheet-location-other:checked ~ .sheet-data.sheet-row { display : grid ; }