Apply CSS to Particular td of a Table

Introduction

In this blog, I will tell you How to Apply CSS to a particular <td> of a table.

You might have been wondering how you can apply CSS to only some of the <td> and not to the other ones!!

This blog will solve your problem.

Step 1

First of all, create a table in which add 2-3 <td> under one row(<tr>).

        <table>

            <tr>

                <td>

                    Hello

                </td>

                <td>

                    Hello

                </td>

                <td>

                    Hello

                </td>

            </tr>

        </table>

Step 2

Now, add this CSS in the head section:

<head>

    <title></title>

    <style>

        table td + td + td {

            colorred;

        }

    </style>

</head>

Output

On running the application an output like this will be seen:

apply css to particular td

Ebook Download
View all
Learn
View all