Search code examples
javascripthtmlhtml-tableweb-deployment

how can i add space between table border and text using html only?


the image is the final output I want

HI can someone pls help me I am new to code and this is my college assignment in which we are not supposed to use CSS, only using HTML how can I add space between text and table-border.

<!DOCTYPE html>
  <HTML>

  <HEAD>
    <TITLE>TABLE</TITLE>
  </HEAD>

  <BODY>
    <TABLE BORDER="5" CELLSPACING="4" CELLPADDING="3">
      <TR BGCOLOR="BLUE">
        <TH ALIGN="CENTER" HEIGHT="20">
          <FONT SIZE="4" COLOR="WHITE"> <u>First Name</u>
        <TH ALIGN="CENTER" HEIGHT="20">
          <FONT SIZE="4" COLOR="WHITE"> <u>Last Name</u>
      </TR>
      <TR BGCOLOR="YELLOW">
        <TD> <u>Keith</u>
        <TD><u>Richards</u>
      </TR>
      <TR BGCOLOR="ORANGE">
        <TD><u>Mick</u>
        <TD><u>Jagger</u>
      </TR>
      <TR BGCOLOR="YELLOW">
        <TD><u>Bill</u>
        <TD><u>Wyman</u>
      </TR>
      <TR BGCOLOR="ORANGE">
        <TD><u>Ron</u>
        <TD><u>Wood</u>
      </TR>
      <TR BGCOLOR="YELLOW">
        <TD><u>Charlie</u>
        <TD><u>Watts</u>
      </TR>
      <TR BGCOLOR="ORANGE">
        <TD><u>Mick</u>
        <TD><u>Taylor</u>
      </TR>
      <TR BGCOLOR="YELLOW">
        <TD><u>Brian</u>
        <TD><u>Jones</u>
      </TR>
    </TABLE>
  </BODY>

  </HTML>

my code-


Solution

  • <TD> <u>&nbspKeith</u> </TD>
    

    Try using &nbsp should give you the desired result.