Question

I am looking to insert the align attribute for centering column data. I have several lines that are similar in composition to this:

tdHtml = tdHtml + "<td style=\"width:42px;\">" + PriorityFormat($(this).attr("ows_Priority_x0020_Number")); + "</td>";

Is this doable?

Thanks!

Était-ce utile?

La solution 2

Vega and Sushanth have answered this question in the comments above. I used

"<td style=\"width:42px;text-align:center \">"

Autres conseils

Don't use inline css add class or target td by parent selector

Example:

tdHtml = tdHtml + "<td class='td-center'>" + PriorityFormat($(this).attr("ows_Priority_x0020_Number")); + "</td>";

CSS

.td-center {width:42px; text-align:center}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top