Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET CSS HTML , +
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 6-Feb-13 23:29pm
Kavitha_b1.4K
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi Kavitha
<table><tbody><tr><td style="font-weight:bold; font-color:Blue;">xxxxxxx</td></tr></tbody></table>
Cheers,
Edo
  Permalink  
v3
Comments
manognya kota at 7-Feb-13 4:38am
   
Is the "bold " tags required here??:)
 
"font-color:Blue;"
Edo Tzumer at 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 at 7-Feb-13 4:40am
   
:)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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.
  Permalink  
Comments
Ankur\m/ at 7-Feb-13 7:28am
   
5 for the CSS suggestion!
Pete O'Hanlon at 7-Feb-13 8:06am
   
Thanks.
Kavitha le at 7-Feb-13 8:01am
   
Thanks
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

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!
  Permalink  
Comments
RockingDev at 7-Feb-13 6:52am
   
^
Kavitha le at 7-Feb-13 8:01am
   
Thanks
shiny13 at 7-Feb-13 8:34am
   
no problem!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 8

That's an INLINE STYLE SHEET
Better go for extended style sheets. It helps you to design the page in a quick time
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 9

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6


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

Happy coding!!!!!!
  Permalink  
Comments
Ankur\m/ at 7-Feb-13 7:28am
   
What extra did you add to the answer? This was already told in the above answers.
RockingDev at 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/ at 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.
RockingDev at 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)

  Print Answers RSS
0 OriginalGriff 475
1 Maciej Los 349
2 Richard MacCutchan 220
3 BillWoodruff 219
4 Mathew Soji 160
0 OriginalGriff 8,759
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,269
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web01 | 2.8.1411028.1 | Last Updated 12 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100