I'm working with some legacy code and encountered the following issue.
I'm using YAHOO.widget.DataTable structure to modify html elements in a table.
I am running a basic number to US currency conversion on the code in one td of this table. It works for other tables however it fails in this table because all elements are set to bold.
Ex:
<td>
<b><s:property value="totalTransactions"/></b>
</td>
My preffered solution is to remove the b tags.
So the code can run (and doesn't need to differ between different tables and it doesn't need to clean them all first and then attempt to distinguish when it should add bold tags back)
For example I could check if html exists remove it, modify the number, and then add the html back. I think it's cleaner (personal preference perhaps) to modify the table so that it keeps the bold font for all elements in it without adding text inside the td tag.
I looked at: Bold a single line in html table <td>
and a few other examples however they all indicated using text in the td tag itself. I saw examples of things like or Is there a way to do this without? Sorry I'm not super familiar with html. I know in some other languages I might be able to set a property.
I was hoping for a solution like (pseudocode below):
<td font-type=bold> ... </td>
or a table change
<table font-type=bold>...
I searched http://ift.tt/1DePR6E but while I can set the color it does not appear that I can set the font type. Any other work arounds to changing the table itself.
Essentially my YAHOO.widget.DataTable structure (not my choice to use) is pulling in the information from the td tag (info inside) and then having trouble because this one table cell is different from all the others (because it is bolded). I would prefer to keep my same solution for ease of readability, and maintainability and simply change the way the table elements are bolded. The entire table is bolded but in such a way that each element is .
Thanks!
Edit - additionally I would prefer to not create a separate css sheet for just this one element. I was hoping for a neat way to do it using the table itself.
tl;dr: I want to bold my entire table without using bold tags (or anything else) inside each td tag because the data inside each td tag is being read in and causing errors.
Aucun commentaire:
Enregistrer un commentaire