First, check your browser make / version: border-spacing not supported in IE6 / 7. Secondly, border-spacing only works when the border-collapse parameter of the table is set to separate . Probably some special PrimeFaces style sheet set it to collapse (which is the preferred form for representing borders in the common user interface). Thus, border-spacing will not work.
Thus, all this should work, including IE6 / 7 hacking the latest announcement:
.yourTableClass { border-collapse: separate; border-spacing: 10px; *border-collapse: expression('separate', cellSpacing = '10px'); }
with
<p:dataTable styleClass="yourTableClass">
(prefer classes by inline styles)
Update : according to the screenshot and comments, PrimeFaces wraps the generated HTML <table> inside the <div> and applies style / styleClass on it instead of the wrapped <table> . I did not expect this. In this case, you need the following CSS declaration:
.yourTableClass table { border-collapse: separate; border-spacing: 10px; *border-collapse: expression('separate', cellSpacing = '10px'); }
source share