td.productsTable won't work because you have no <td> elements with a productsTable class.

However, your second CSS rule, .productsTable td, this will work because you do have <td> elements that have a parent element with the class productsTable.

I've made a quick fiddle of this, and you can see it working correctly:

td {
  border: 1px dotted #999;
}
<table width="100%" height="100%" cellspacing="2px;">
  <tr>
    <td width="40%">We Offer:</td>
    <td width="20%" align="center">e-phone FREE</td>
    <td width="20%" align="center">Personal</td>
    <td width="20%" align="center">Pro PBX</td>
  </tr>
  <tr>
    <td width="40%">Pricing</td>
    <td width="20%" align="center">FREE</td>
    <td width="20%" align="center">ยฃ3 per month</td>
    <td width="20%" align="center">From ยฃ5 per month</td>
  </tr>
</table>

If this isn't working for you, its likely that you have either not correctly linked your CSS file, or there is another CSS rule overriding this. Try inspecting element to see.

Answer from Curtis on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ html_table_borders.asp
HTML Table Borders
table, th, td { border: 1px solid black; border-collapse: collapse; } Try it Yourself ยป ยท If you set a background color of each cell, and give the border a white color (the same as the document background), you get the impression of an invisible border:
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ html โ€บ html-table-border-attribute
HTML table border Attribute - GeeksforGeeks
July 11, 2025 - The HTML <table> border Attribute is used to specify the border of a table. It sets the border around the table cells. This attribute defines the visual presentation of the table by setting the thickness of the borders.
๐ŸŒ
W3C
w3.org โ€บ Style โ€บ Tables โ€บ examples.html
Examples of table borders and rules
It can be solved in several ways: (1) in HTML, by putting the cell content inside another element, such as a P or DIV and putting a background on that, or (2) introducing a border-background property, or (3) specyfing that the table background is used for the border background.
๐ŸŒ
DhiWise
dhiwise.com โ€บ post โ€บ the-ultimate-guide-to-html-table-border-styling
Elevate Your Website with Modern HTML Table Border Styling
June 4, 2024 - A single border around the whole table or individual table cells can be achieved by specifying a border with a 1px solid style.
๐ŸŒ
Screenstepslive
utah.screenstepslive.com โ€บ a โ€บ 1864861-table-borders-and-shading
Table Borders and Shading | Advanced HTML Elements | University of Utah
In addition, much like image borders, you can specify table borders using (border), (border-top), (border-right), (border-bottom), or (border-left) followed by the desired border width (border-width), color (border-color) and style (border-style), or you can specify all three at once using, ...
๐ŸŒ
HTML AM
html.am โ€บ html-codes โ€บ tables โ€บ table-border.cfm
Table Border
Using CSS, you use the border property to define the table border. You can apply this property against the whole table or each cell (or a single cell, if that's what you prefer).
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ HTML โ€บ Reference โ€บ Elements โ€บ table
<table>: The Table element - HTML | MDN
With CSS, we provide the basic ... data structure clearer. The CSS adds a solid border around the <table> and around each of the table's cells, including those specified with both <th> and <td> elements, demarcating every header and data cells....
Find elsewhere
๐ŸŒ
HTML Tables
htmltables.io โ€บ blog โ€บ html-table-borders
HTML Table Borders โ€” A Complete Guide
April 17, 2024 - In addition to color, HTML tables offer a wide range of border styles to choose from, each with its own unique visual effect and practical application. Let's explore the various border styles available: The classic solid line border, often used for clear delineation and a professional appearance. This is by far the most common style used for borders. /* Apply border to table and cells */ table { border: 1px solid black; /* Solid black border */ } th, td { border: 1px solid black; /* Solid black border */ padding: 0.5rem; /* Optional: Add padding for content */ }
๐ŸŒ
W3Schools
w3schools.com โ€บ css โ€บ css_table.asp
CSS Styling Tables
The CSS border-collapse property sets whether table borders should collapse into a single border or be separated as in standard HTML. This property can have one of the following values: separate - Default value. Borders are separated; each cell will display its own borders
๐ŸŒ
CSS-Tricks
css-tricks.com โ€บ table-with-borders-only-on-the-inside
4 Ways to Make a Table With Borders Only On The Inside (Tic-Tac-Toe Style) | CSS-Tricks
January 5, 2022 - All thatโ€™s needed is to add a transparent border to the table element that is 1px wider than the border on the cells and as per border conflict resolution the wider border should be used in favour of the narrower border.
๐ŸŒ
W3Schools
w3schools.com โ€บ html โ€บ tryit.asp
W3Schools online HTML editor
The W3Schools online code editor allows you to edit code and view the result in your browser
๐ŸŒ
wpDataTables
wpdatatables.com โ€บ home โ€บ blog โ€บ html table borders: the complete guide to creating, styling, and customizing
HTML Table Borders: The Complete Guide to Creating, Styling, and Customizing
1 day ago - The border attribute is the simplest way to add borders directly in HTML. Itโ€™s easy to implement but limited in customization. ... In the blink of an eye, borders appear. A straightforward approach โ€” like grabbing the first pencil you see. This method quickly adds visible borders to each table cell.
๐ŸŒ
Hyperskill
hyperskill.org โ€บ university โ€บ frontend โ€บ html-table-borders
HTML Table Borders
October 2, 2024 - To apply a border around the entire table, target the <table> element in your CSS:โ€ ... To ensure that individual cells and headers also have borders, target the <th> and <td> elements:โ€ ... The border attribute in HTML is a simple way to add borders to an HTML table.
๐ŸŒ
Quackit
quackit.com โ€บ html โ€บ codes โ€บ tables โ€บ html_table_border.cfm
HTML Table Border
HTML table borders are specified using Cascading Style Sheets (CSS). To set the border of an HTML table, use the CSS border property. ... This provides that "grid" like effect, where the border surrounds each cell as well as the whole table.
๐ŸŒ
ETSU Faculty
faculty.etsu.edu โ€บ tarnoff โ€บ ntes1710 โ€บ tables โ€บ tables.htm
HTML Table Basics
The HTML for a basic table is shown below. <table border="1"> <caption>Table Caption</caption> <tr> <td> Row 1, col 1 item </td> <td> Row 1, col 2 item </td> <td> Row 1, col 3 item </td> </tr> <tr> <td> Row 2, col 1 item </td> <td> Row 2, col 2 item </td> <td> Row 2, col 3 item </td> </tr> </table> The resulting table is shown below. Note that I had to add the "border=1" attribute to define the cells of the table with lines.
๐ŸŒ
W3Docs
w3docs.com โ€บ html
How to Add Border to HTML Table
You can give styling to your table using the CSS border shorthand property, or the border-width, border-style, border-color properties, separately. See the example below to have a visible result of these properties.
๐ŸŒ
PW Skills
pwskills.com โ€บ blog โ€บ web development โ€บ border table html โ€“ css, without css, style
Border Table Html - CSS, Without CSS, Style
November 4, 2025 - If you wish to remove the border around your table, you can simply use the border attribute inside the <table> html tag and change its value to โ€œ0โ€. Check the code implementation below.
๐ŸŒ
HTML.com
html.com โ€บ attributes โ€บ table-border
Table Border: The Old (HTML) And New (CSS) Code Compared ยป
September 26, 2019 - table.example-table, .example-table td{border: 1px solid green; border-collapse: collapse;}