Alain Bensimon
asked on
Select all tables with a given class and apply a class to the firt cell and another one to the second cell.
Hello,
I am working on a html document and I have the following tables
<table class="titles">
<tr>
<td class="cells">Nom de l'assuré</td>
<td class="content">{{#childta ble.place. rows}}{{fi elds.name} }{{/childt able.place .rows}}</t d>
</tr>
<tr>
<td class="cells">Lieu du sinistre</td>
<td class="content">{{#childta ble.addres s_view.row s}}{{field s.address} } -&n bsp;{{fiel ds.second_ address}}{ {/childtab le.address _view.rows }}</td>
</tr>
<tr>
<td class="cells">Adresse de l'assuré</td>
<td class="content">{{#childta ble.addres s_view.row s}}{{field s.address} } -&n bsp;{{fiel ds.second_ address}}{ {/childtab le.address _view.rows }}</td>
</tr>
<tr>
<td class="cells">N° de dossier</td>
<td class="content">{{#childta ble.reques t.rows}}{{ fields.use r_def16}}{ {/childtab le.request .rows}}</t d>
</tr>
</table>
With the following CSS:
.titles{
border-left: solid grey;
border-width: thick;
border-collapse: collapse;
}
.cells{
font-weight: bold;
background-color: lightgrey;
padding-left: 3px;
width: 25%;
}
.content{
background-color: paleturquoise;
width: 75%;
padding-left: 3px;
border: solid thin black;
border-width: 0px 0px 1px 1px;
}
Since I have a lot fof tables with taht layout, and I want to avoid to put the class .cells and the class .content to all the cells of the table, I would like a css code that can select all tables that have the class "titles" and apply them the class.
Thank you
I am working on a html document and I have the following tables
<table class="titles">
<tr>
<td class="cells">Nom de l'assuré</td>
<td class="content">{{#childta
</tr>
<tr>
<td class="cells">Lieu du sinistre</td>
<td class="content">{{#childta
</tr>
<tr>
<td class="cells">Adresse de l'assuré</td>
<td class="content">{{#childta
</tr>
<tr>
<td class="cells">N° de dossier</td>
<td class="content">{{#childta
</tr>
</table>
With the following CSS:
.titles{
border-left: solid grey;
border-width: thick;
border-collapse: collapse;
}
.cells{
font-weight: bold;
background-color: lightgrey;
padding-left: 3px;
width: 25%;
}
.content{
background-color: paleturquoise;
width: 75%;
padding-left: 3px;
border: solid thin black;
border-width: 0px 0px 1px 1px;
}
Since I have a lot fof tables with taht layout, and I want to avoid to put the class .cells and the class .content to all the cells of the table, I would like a css code that can select all tables that have the class "titles" and apply them the class.
Thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER