Click here to Skip to main content
15,890,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
XML
in my application am using
<td style="font-weight:bold" >xxxxxxx</td>
but i want to adjust the width of the <td> too.
so how can i do that here?  i already used style tag?
how can i give two attributes?
Posted

Hi Kavitha
HTML
<table><tbody><tr><td style="font-weight:bold; font-color:Blue;">xxxxxxx</td></tr></tbody></table>

Cheers,
Edo
 
Share this answer
 
v3
Comments
manognya kota 7-Feb-13 4:38am    
Is the "bold " tags required here??:)

"font-color:Blue;"
Joezer BH 7-Feb-13 4:40am    
Nah,
I wanted to emphasize the second attribute
but now that it's scrambled I've removed it.

Tnx
manognya kota 7-Feb-13 4:40am    
:)
Whenever you need to add multiple styles, all you need to do is separate them by a semi-colon. Edo has given a simple example in Solution 1. I would, however, advise against using inline styles; while they may seem convenient at first, they can end up causing you a lot of pain should you decide to modify stylings via CSS. There's a reason that CSS is called Cascading Style Sheets.

Basically, what happens is; you define a rule in one stylesheet and this rule is quite general. Possibly you add an override in a stylesheet that applied after the first stylesheet - thus modifying the appearance. Now, you think that all should be good, but there's one pesky item that doesn't render the way you want it to, no matter how many times you modify your stylesheets. It's up to you to track this down, and what do you find? It's a style that's defined directly on an element - trumping all the styles in the stylesheet because it's given more prominence.

The bottom line is, don't use inline styles. Use stylesheets instead as it can make your life a lot easier later on.
 
Share this answer
 
Comments
Ankur\m/ 7-Feb-13 7:28am    
5 for the CSS suggestion!
Pete O'Hanlon 7-Feb-13 8:06am    
Thanks.
Am Gayathri 7-Feb-13 8:01am    
Thanks
You should spend about 3-4 hours on just learning basics of HTML and CSS before implementing things. You're life will be made much easier. The following will help:

1. Video tutorials from pluralsight.com
2. HTML Dog: http://www.htmldog.com/guides/cssbeginner/[^]
3. http://w3schools.com/[^]

Your life will be made much easier, happy coding!
 
Share this answer
 
Comments
Career Web Helper 7-Feb-13 6:52am    
^
Am Gayathri 7-Feb-13 8:01am    
Thanks
shiny13 7-Feb-13 8:34am    
no problem!
SQL
That's an INLINE STYLE SHEET
Better go for extended style sheets. It helps you to design the page in a quick time
 
Share this answer
 
 
Share this answer
 

while applying multiple attributes by using style you need to do is separate the attributes by using semicolon like;
HTML
<table><tbody><tr><td style="font-weight:bold;width:20;">xxxxxxx</td></tr></tbody></table>


Happy coding!!!!!!
 
Share this answer
 
Comments
Ankur\m/ 7-Feb-13 7:28am    
What extra did you add to the answer? This was already told in the above answers.
Career Web Helper 8-Feb-13 8:33am    
@Ankur\m/ the Que was like this "but i want to adjust the width of the <td> too.so how can i do that here? i already used style tag?"
and in above answer it was not specified.
Ankur\m/ 10-Feb-13 23:45pm    
The above answers also said the same thing - use semicolon (in fact more than that - about using style sheets). You repeated the same thing in your answer.
Career Web Helper 11-Feb-13 9:58am    
please read the comments of above answer...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900