If I have a component named MyComponent
with a table in its view
<table>
<thead>
<tr>
<th class="col1">COL1</th>
<th class="col2">COL2</th>
<th class="col3">COL3</th>
</tr>
</thead>
<tbody>
<tr *ngFor="#item of items">
<td class="col1">{{item.content1}}</td>
<td class="col2">{{item.content2}}</td>
<td class="col3">{{item.content3}}</td>
</tr>
</tbody>
</table>
I want to place MyComponent inside different containers (e.g. Container1
and Container2
) and set specific attributes for the table (like column width) using CSS files attached to the containers. For example, in Container1
, CSS file could be defined as:
.col1 {
width: 40%;
}
.col2 {
width: 30%;
}
.col3 {
width: 30%;
}
And in Container2, a different CSS file with different attributes could be used. Is this achievable? Thank you