Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours scrolling social media and waste money on things we forget, but won’t spend 30 minutes a day earning certifications that can change our lives.
Master in DevOps, SRE, DevSecOps & MLOps by DevOpsSchool!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

How to set Table width, height, color & padding using CSS?

CSS

Empty-cells

This property is used to set whether or not to display borders and background on empty cells in a table. It will work only if the border-collapse is set to separate. We can set this property to show (default) or hide.

Ex:-

table { table-layout: fixed; }

How to set Table width and Height?

We use width and height property to set table width and height.

We can also set table heading (th) width and height.

table { width: 100% ;}

th { height: 10px; }

How to set Table Padding?

This property is used to control the space between the border and the content in a table, this is used on <td> and <th> elements.

th, td { padding: 10px; }

How to set Table color?

table {background-color: pink;}

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x