Home Set cellpadding and cellspacing in CSS?
Reply: 0

Set cellpadding and cellspacing in CSS?

user6824
1#
user6824 Published in September 19, 2018, 11:45 am

In an HTML table, the cellpadding and cellspacing can be set like this:

<table cellspacing="1" cellpadding="1">

How can the same be accomplished using CSS?

share|improve this question
  • 4
    Just a general suggestion, check to see if your style.css does a "reset" on your tables before trying these solutions. Example: If you don't have tables set to width:auto then border-collapse might not work as expected. – PJ Brunet Sep 1 '16 at 7:12
  • 1
    Use border-spacing on table and padding on td. – Anubhav May 23 '17 at 9:17

26 Answers 26

active oldest votes
up vote 3259 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.618179 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO