Ajax Souce and give individual cells a different class name
Ajax Souce and give individual cells a different class name
I have my Table working fine and rendering fine by getting the table data from an ajax source absolutely fine. (I have full control over the data that is being generated through PHP and mysql). Quite often the data will consist of blank cells (which I return as empty strings). What I would like to do is to be able to style these using CSS, for example empty cells being coloured dark grey. There will also be spacer columns that need to be a certain width and colour. Does anyone know how you can add classes to the td cells that get generated on an individual basis.
I can calculate what the td class attr should be in the php ajax source calculation, but I can't work out how then to use it.
A simple example:
Text To Display
Text To Display
Where td.empty {background-color:grey} would want to work. and td.data {color:red}.
I could use a span with an id in the returned cell contents from the ajax source, but there are times when I want to change the cell border, widths etc.
Thanks
I can calculate what the td class attr should be in the php ajax source calculation, but I can't work out how then to use it.
A simple example:
Text To Display
Text To Display
Where td.empty {background-color:grey} would want to work. and td.data {color:red}.
I could use a span with an id in the returned cell contents from the ajax source, but there are times when I want to change the cell border, widths etc.
Thanks
This discussion has been closed.
Replies
Allan