You need to sign in to do that
Don't have an account?
JeffreyStevens
css in component
Can I put a style tage in a component?
For example?
Col1 header has a border around it, Col2 and 3 do not.
Am I missing something?
For example?
<apex:component id="AComponent"> <style type="text/css"> .THIS.table.td {border:1px solid black;} </style> <table > <th> <td style="border:1px solid black;">Col1</td> <td>Col2</td> <td>Col3</td> </th> <tr> <td>[Col1 Data...]</td> <td>[Col2 Data...]</td> <td>[Col3 Data...]</td> </tr> </table> </apex:component>
Col1 header has a border around it, Col2 and 3 do not.
Am I missing something?
All Answers
This will select every table's td and will but a border around them. You are probably better putting a class or id on your table and adding that to your CSS selector.
I am agree with ' PCON ' , You can also use this code for better result,
<style>
table {
border-collapse: collapse !important;
}
table, th, td {
border: 1px solid black !important;
}
</style>
Thanks!!
However, what I'm trying to understand is - is there any difference when the style tags are in a COMPONENT. And how does the THIS. play into it?
Thanks
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_css.htm
One more thing - what's with the !important - that's new to me. What is it for?