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, 2022 in CSS by Edureka
• 13,620 points
620 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, 2022 by Edureka
• 12,690 points

Related Questions In CSS

0 votes
0 answers

How do I center a list of text and then justify it in a w3.css column?

I am unable to center the contact ...READ MORE

Aug 17, 2022 in CSS by Edureka
• 13,620 points
708 views
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, 2022 in CSS by Edureka
• 12,690 points
2,794 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 Jun 28, 2022 in CSS by Edureka
• 12,690 points
5,719 views
0 votes
1 answer

How to overlay image with color in CSS?

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

answered Jun 28, 2022 in CSS by Edureka
• 12,690 points
944 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
10,546 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,250 points
2,853 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
933 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 3,647 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, 2022 in CSS by Edureka
• 12,690 points
2,046 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, 2022 in CSS by Edureka
• 12,690 points
607 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP