Link to home
Start Free TrialLog in
Avatar of janhoedt
janhoedt

asked on

CSS HTML: format only 1 table in CSS

Hi,

How do I format a certain table in css (like this: https://www.w3schools.com/css/tryit.asp?filename=trycss_table_border_divider), while leaving alone other tables in my html?

J.
Avatar of Dustin Saunders
Dustin Saunders
Flag of United States of America image

You can create a new css class and assign it to the specific table, or you could use the style attribute on the table itself to customize.
ASKER CERTIFIED SOLUTION
Avatar of lenamtl
lenamtl
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of janhoedt
janhoedt

ASKER

I'm explicitely mentionig the example

<style>
table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}
</style>

You only mention the table but what about the th and td