0

Is it possible to override the table-specific attributes/values shown below (border, cellpadding, cellspacing) with CSS? I can't get to the HTML here to remove those attributes/values, so an external CSS file is all I have to work with!

<table border="1" cellpadding="1" cellspacing="1">
Sam
  • 2,152
  • 6
  • 31
  • 44
  • P.S. I know I could use jQuery to remove the attributes, but I'm holding out for a cleaner, CSS-only solution. – Sam Jun 17 '15 at 17:53
  • Can't you just use `table{your changes here }` in your css? – Adam Buchanan Smith Jun 17 '15 at 17:54
  • 1
    The answer was previously mentioned here: http://stackoverflow.com/questions/339923/set-cellpadding-and-cellspacing-in-css – designarti Jun 17 '15 at 17:56
  • Unless I'm not targeting the `` correctly, my CSS can't override those inline attributes.
    – Sam Jun 17 '15 at 18:00
  • If you want a 'clean' approach, the best way is to have the back-end not produce the attribute mark-up you're trying to override. Though, given that the "*CSS...is all [you] have to work with*" it seems that advice is either too late, or of very limited use. – David Thomas Jun 17 '15 at 19:19
  • Okay. I'm an idiot. I pointed the style overrides at the ``s instead of the `` and all is well.
    – Sam Jun 17 '15 at 20:42

1 Answers1

1

Try this:

table{
 border:0;
 border-collapse: collapse;
 border-spacing: 0;
 padding:0;
}
gopalraju
  • 2,299
  • 1
  • 12
  • 15
  • See my comment above. Basically, you're right. I pointed my styles at the ``s instead of directly at the `` and all seemed to work. Ugh. Thanks.
    – Sam Jun 17 '15 at 20:44