Skip to content Skip to sidebar Skip to footer

Make Contents Of A Table Or Td Tag Bold

I'm working with some legacy code and encountered the following issue. I'm using YAHOO.widget.DataTable( elContainer, aColumnDefs, oDataSource, oConfigs ) structure to modify html

Solution 1:

From what I understood form your question there are 2 possible solutions with inline css.

First one

<html><head><style>tabletd {
        font-weight:bold;
    }
</style></head><body><table><tr><td>Text inside table cell</td></tr></table></body></html>

Second one

<table><tr><tdstyle="font-weight:bold">Text inside the table</td></tr></table>

one with css declaration:

tabletd {
            font-weight:bold;
        }

Another solution will be using strong tag to wrap the text.

<table><tr><td><strong>Text goes here</strong></td></tr></table>

Solution 2:

I hope I understood the question correctly and your goal is to bold all text in one table. This inline style makes all texts in the cells from the table bold:

<table style="font-weight: 700;">...

or a more readable version:

<table style="font-weight: bold;">...

Solution 3:

While the other two answer at the moment have covered the basics, using either strong tag or using a css style (inline or in a style dec).

If the above two still fail, perhaps another means would be using javascript or jquery to enumerate over the table and apply a bold style afterwards either directly to each td cell or table by applying a css or inserting your own b/strong tags.

This may not be an option in your case, but being others will see this. There are still times when this is called for.

I wont post any code as the basics are covered, unless you need a Javascript/jQuery code.

Post a Comment for "Make Contents Of A Table Or Td Tag Bold"