Question: Create a rule that displays the table, thead, tbody, tr , td , and th elements as block elements. We don't want the rows inside
Create a rule that displays the table, thead, tbody, tr td and th elements as block elements.
We don't want the rows inside the thead element to show in mobile view because we will replace these a little later. However, we can't just hide the rows because we need to have them for accessibility reasons. So instead of just hiding them, we will position them offscreen. Create a rule for any rows inside the thead that positions them using absolute positioning, and setting the left and top to pixels.
Now, in order to help distinguish the data in each row, we want to add a border. Create a rule for any row element that adds a pixel solid border using the color #aaaaaa.
Because we don't have the table header anymore, we will add "headers" to each cell. To make space for the "header", we need to add left padding to each data cell. Create a rule for any tabe cell that
adds left padding,
allows the text to wrap by setting the wordbreak property to breakwork,
removes the border,
adds a pixel solid border using the color #cccccc to the bottom,
and positions the element using relative positioning.
To add the "header" to each data cell, we will use the before pseudoelement. Create a rule for the before pseudoelement for any table cell that positions the element using absolute positioning with the left set to pixels and the top to and transforms the element moving it on its Y axis, and sets the text to display as bold.
Finally, we need to set the content for each before pseudoelement separately. Create a rule for each table cell that sets the contentproperty using the following:
td:nthoftype:before to First Name
td:nthoftype:before to Last Name
td:nthoftype:before to Grad Year
td:nthoftype:before to Email
td:nthoftype:before to Location
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
