Making text in one column italics with CSS

0 votes

Using CSS, I want to make the text in one column bold. My table currently has the following structure, however I am unable to make the text in the right column bold.

Using CSS, for the head section:

<style>
        .col-right-col{
            font-style: italic;
        }
    </style>
HTML:

<table>
    <colgroup>
        <col class="col-left-col">
        <col class="col-right-col">
    </colgroup>
  <tbody>
    <tr>
      <th scope="col">Left Col Header</th>
      <th scope="col">Right Col Header</th>
    </tr>
    <tr>
      <td>Row 1 Left</td>
      <td>Row 1 Right</td>
    </tr>
    <tr>
      <td>Row 2 Left</td>
      <td>Row 2 Right</td>
    </tr>
    <tr>
      <td>Row 3 Left</td>
      <td>Row 3 Right</td>
    </tr>
</tbody>
</table>
Jun 17 in CSS by Edureka
• 8,060 points
6 views

1 answer to this question.

0 votes

What you can do is using the td:nth-child() to make Row 1/2/3 Right italic:

td:nth-child(2) {
    font-style: italic;
}
answered Jun 17 by Edureka
• 9,540 points

Related Questions In CSS

0 votes
1 answer

Splide.js text animation between slides with animate.css classes

The event callback functions contain an event ...READ MORE

answered Jun 10 in CSS by Edureka
• 9,540 points
24 views
0 votes
1 answer

I want to create a small square colour filled box in HTML & CSS. And most important - I want to write one line after the box

Try using the square html entity: <div style="color:blue">&a ...READ MORE

answered 5 days ago in CSS by Edureka
• 9,540 points
4 views
0 votes
1 answer

How to overlay image with color in CSS?

Use the rgba() Function to Overlay Background ...READ MORE

answered 5 days ago in CSS by Edureka
• 9,540 points
8 views
0 votes
1 answer

when declaring css styles, what is the meaning of .classA.classB (two class names with a dot in the middle and no space)

The first example (space-separated classes) is a ...READ MORE

answered 5 days ago in CSS by Edureka
• 9,540 points
10 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
4,500 views
0 votes
1 answer

Using/Handling colon inside a JSF generated HTML element ID in CSS selector

Yes, you can.  Just Backslash (\) the colon.  Like ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,240 points
1,654 views
0 votes
1 answer

What is a css selector and where is it used?

CSS Selector is a combination of element ...READ MORE

answered Nov 21, 2018 in Data Analytics by Kalgi
• 52,350 points
267 views
0 votes
1 answer

What is the difference between span and div?

The div should be used to wrap sections of ...READ MORE

answered Jan 16, 2020 in Web Development by Niraj

edited Jan 21, 2020 by Niroj 2,251 views
0 votes
1 answer

Making a dotted grid with CSS

You can use the background-position CSS property to do ...READ MORE

answered May 31 in CSS by Edureka
• 9,540 points
13 views
0 votes
1 answer

How to insert spaces/tabs in text using HTML/CSS

For spaces, use &nbsp;, for (less than, ...READ MORE

answered Jun 1 in CSS by Edureka
• 9,540 points
15 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP