<td style="text-align:center">
is great, but let’s say I need to do 1000 of them,
and … I am not allowed to use stylesheets.
So what can I put in <table style="what">
that will let me just use just <td>
‘s with no attributes?
<td style="text-align:center">
is great, but let’s say I need to do 1000 of them,
and … I am not allowed to use stylesheets.
So what can I put in <table style="what">
that will let me just use just <td>
‘s with no attributes?
3
Answers
Use
It worked. I don't know why. Chrome browser rendering:
of HTML:
OK, it works for the special case of
style="text-align: center;"
. I didn't test it for the general case.If you cannot use styles tag, you cannot. You will need to inline the style attribute to ALL TDs.
If you are not allowed to use a CSS file, but can still add HTML, you could add styles inline.
you could do this:
You cannot. The
style
attribute affects only the element it’s on and contains no selectors. Is an inline<style></style>
tag possible, rather than an external stylesheet file?For e-mail, especially older or strict clients that don’t support the tag, tools such as this "CSS inliner" were created.
It looks through a
<style></style>
tag and will add astyle
attribute to all tags that match the selectors.For example, this:
Renders as:
Note that some things that are possible in stylesheets, such as
a:hover{}
, can’t be expressed in a style attribute.