[whatwg] <table> Relation between "bordercolor" and "border" attributes
Tab Atkins Jr.
jackalmage at gmail.com
Tue Mar 6 08:35:39 PST 2012
On Tue, Mar 6, 2012 at 1:58 AM, Kishore Bolisetty <ganesh.bksv at gmail.com> wrote:
> Hi All,
> I have been looking at spec for finding relation between html table's
> bordercolor and border attributes.
> When a table<http://www.whatwg.org/specs/web-apps/current-work/#the-table-element>element
> has a
> bordercolor attribute, its value is expected to be parsed using the rules
> for parsing a legacy color
> and if that does not return an error, the user agent is expected to treat
> the attribute as a presentational
> the element's 'border-top-color', 'border-right-color',
> 'border-bottom-color', and 'border-right-color' properties to the resulting
> The table<http://www.whatwg.org/specs/web-apps/current-work/#the-table-element>element's
> to the pixel length
> 'border-right-width', 'border-bottom-width',
> 'border-left-width' on the element. If the attribute is present but parsing
> the attribute's value using the rules for parsing non-negative
> an error, a default value of 1px is expected to be used for that
> property instead.
> But it doesn't talks about the behaviour - what if border is not specified
> but bordercolor is specified? Looks like browsers have taken their own
> implementations on this, Opera and Mozilla displays bordercolor only if
> border is specified, where as Safari displays bordercolor assuming a
> default border.
> Which one is correct behaviour? Is it not necessary to explicitly state
> this in the spec?
> Example Markup :
> <table id="2" borderColor="#00FF00">
> <td >Some Text</td>
This behavior depends on the browser's default stylesheet, and whether
they default borders to "border-style: solid; border-color:
currentColor;" or "border-style: solid; border-width: 0px;". Browsers
are allowed to do either.
More information about the whatwg