css: show table cells

by prettyscripts on 2008-05-22 10:33:51

phpcsshtml

for bordered tables, you can visually see a cell is not displayed (ie no border around the cell) if it has no value. it looks ugly. the work around is usually assigning a space ‘ ’ to the cell in html code.

in css, you can show the cell with empty-cells property. valid values are show and hide.

CSS:

table { empty-cells: show; }

however, IE does not support this property! (surprise!?)

in php code, we can detect browser (via $_SERVER[’HTTP_USER_AGENT’]) to set sell value. if it’s MSIE, set the cell to ‘ ’.

just need to document this to remind myself why tables look ugly on IE.

Tags: cell, css, ie, table

No feedback yet

Leave a comment


Your email address will not be revealed on this site.
PoorExcellent
note: all comments are moderated. do not spam and do not advertise. only comments relevant to the post will be published.
(Line breaks become <br />)
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)