Creating Table Help

I’m working on creating tables via HTML, I have a very basic table set up, I’m trying to apply the “width” CSS rule to my table to expand the size of the table

When i add the width property, the change does not reflect, the class is right - Can someone tell ,me why this style is not being appled. it’s something simple!

Help a tony out!

!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      table,td {
        border: 1px solid gray;
        border-collapse: collapse;
        padding: 5px;
        width: 45px;
      }
    </style>
  </head>
  <body>
    <table>
      <tr>
        <td>Marketing</td>
        <td>$100.00</td>
      </tr>
      <tr>
        <td>Advertising
        <td>$400.00</tr>

        </td>
      </tr>
    </table>
  </body>
</html>

Hi the second row of your table has some issues. You need to add a closing td to the advertising cell and the 400 is closed with tr which is should be td

Thanks for the repsonse, I think I have been coding to long today, is the below correct? Struggling with Syntax a bit here

<table>
      <tr>
        <td>Marketing</td>
        <td>$100.00</td>
      </tr>
      <tr>
        <td>Advertising</td>
        <td>$400.00</td>
      </tr>
    </table>``````



``

Hi yes that should work for the width now

Good Morning, thank you for the response - The width changes are not reflecting, but I will keep going here.

Hi the code below is working you can try on code pen maybe your browser cache is not updated, you can try clear your cache or go incognito. The width will change with different values

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
  <style>
    table, td {
      border: 1px solid gray;
      border-collapse: collapse;
      padding: 5px;
      width: 45px;
    }
  </style>
</head>
<body>
  <table>
    <tr>
      <td>Marketing</td>
      <td>$100.00</td>
    </tr>
    <tr>
      <td>Advertising</td>
      <td>$400.00</td>
    </tr>
  </table>
</body>
</html>