Frederic CS
Frederic CS

Reputation: 99

css not to overwite table cellpadding='10'

I have an html editor (ckeditor). I can make space easily with it that gave me that code

I have some css above this code which break my first line of ckeditor. so cellpadding is useless and that is not what I am looking for

I tried a class nostyle with no success (it is at the end of my post)

<div class='nostyle'>
<p>my title</p>
<!--- beginning of ckeditor source --!>
<table align="center" border="1" cellpadding="10" cellspacing="10" style="margin:100px; padding:100px">
<tbody>
<tr>
<td style="vertical-align:bottom"><img alt="" src="box4m3.png" style="height:147px; width:146px" /></td>
<td style="vertical-align:bottom"><img alt="" src="box8m3.png" style="height:200px; width:199px" /></td>
<td style="vertical-align:bottom"><img alt="" src="box12m3.png" style="height:250px; width:248px" /></td>
</tr>
</table>
<!--- end of ckeditor source --!>   

nostyle css:

.nostyle{
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
}.nostyle{
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
}

Upvotes: 2

Views: 772

Answers (1)

Quentin
Quentin

Reputation: 943605

This isn't possible.

The specification requires than when an HTML presentational rule and a CSS rule conflict, the CSS will always win.

The UA may choose to honor presentational attributes in an HTML source document. If so, these attributes are translated to the corresponding CSS rules with specificity equal to 0, and are treated as if they were inserted at the start of the author style sheet. They may therefore be overridden by subsequent style sheet rules. In a transition phase, this policy will make it easier for stylistic attributes to coexist with style sheets.

nostyle.css defines padding for td and th elements, so it will always overwrite a cellpadding attribute.

Upvotes: 2

Related Questions