weavejester / hiccup

Fast library for rendering HTML in Clojure
http://weavejester.github.io/hiccup
Eclipse Public License 1.0
2.68k stars 174 forks source link

Not all properties make it through #125

Closed yatesco closed 8 years ago

yatesco commented 8 years ago

Hi, [:td {:align "center"}] produces <td></td>. This seems a bug as [:td {:colSpan 2}] works fine.

Is there some magic I need to do (and please don't say 'yeah, don't use tables' ;-)).

mvitz commented 8 years ago
user=> (use 'hiccup.core)
nil
user=> (html [:td {:align "center"}])
"<td align=\"center\"></td>"
user=>
weavejester commented 8 years ago

I get exactly the same as @mvitz, and there's no code specific to table elements in Hiccup. Are you sure you're using Hiccup and not some other library with Hiccup syntax (like Reagent or similar)?

yatesco commented 8 years ago

I'm a numpty - yes, I am using reagent. Sorry for the noise (and thanks for the excellent hiccup!).

weavejester commented 8 years ago

Reagent uses the React DOM, which unlike Hiccup has a bounded set of elements and attributes. The align attribute on table elements has been deprecated, so it's likely that React doesn't support it. Instead, CSS should be used.