troubleshooting Question

Remove all Attributes from Html code

Avatar of kingent85
kingent85Flag for United States of America asked on
Web Languages and StandardsHTMLPHP
6 Comments1 Solution544 ViewsLast Modified:
I would like to remove all attributes from my html so that I can parse it easier. For instance on <table id="CDFTradeDetailFull1" cellspacing="0" cellpadding="0" width="650"
      summary="" border="0"> I'd like to remove cellspacing cellpadding width and summary and border. Need to keep table id. These should all be removed through entire code. How do I accomplish this?

Giving an example file to show the different attributes
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
 
<body>
<table id="CDFTradeDetailFull1" cellspacing="0" cellpadding="0" width="650"
      summary="" border="0">
  <tbody>
    <tr>
      <td class="arial11Black" valign="bottom"><br />
          <strong>ALLTEL
            COMMUNICATIONS </strong></td>
      <td></td>
      <td></td>
    </tr>
    <tr>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="1.54%" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
    </tr>
    <tr>
      <td width="49.23%"><table id="CDFTradeDetailFull2" cellspacing="0" cellpadding="0"
            width="100%" summary="" border="0">
        <tbody>
          <tr>
            <td valign="top" align="left" width="50%"><span
                  class="arial12Rusty">Address:&nbsp;</span><br />
                  <span
                  class="arial11Black">1 ALLIED DR BLDG 5<br />
                    LITTLE ROCK,
                    AR&nbsp;72202<br />
                    (800) 255-8351 <br />
                  </span></td>
            <td valign="top" align="left" width="50%"><span
                  class="arial12Rusty">Account Number:</span><br />
                  <span
                  class="arial11Black">916024.... </span></td>
          </tr>
        </tbody>
      </table></td>
      <td width="1.54%"></td>
      <td valign="top" align="left" width="49.23%"></SPAN></td>
    </tr>
    <tr>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/clear.gif"
          width="100%" /></td>
      <td width="1.54%" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/clear.gif"
          width="100%" /></td>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/clear.gif"
          width="100%" /></td>
    </tr>
    <tr>
      <td valign="top" align="left" width="49.23%"><span
            class="arial12Rusty">Address Identification Number:</span><br />
          <span
            class="arial11Black">0054389474 </span><br /></td>
      <td width="1.54%"></td>
      <td width="49.23%"></td>
    </tr>
    <tr>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="1.54%" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
    </tr>
    <tr>
      <td valign="top" align="left" width="49.23%"><span
            class="arial12Rusty">Status:&nbsp;</span> <span
            class="arial11Black">Account charged off. $129 written off. </span><br /></td>
      <td width="1.54%"></td>
      <td valign="top" align="left" width="49.23%"><span
            class="arial12Rusty">Status Details:&nbsp;</span> <span
            class="arial11Black">This account is scheduled to continue on record
        until Feb 2014. <br />
        This item was verified on May 2008 and remained
        unchanged. <br />
        <br />
      </span></td>
    </tr>
    <tr>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="1.54%" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
    </tr>
    <tr>
      <td valign="top" align="left" width="49.23%"><table id="CDFTradeDetailFull3" cellspacing="0" cellpadding="0"
            width="100%" summary="" border="0">
        <tbody>
          <tr>
            <td valign="top" align="left" width="50%"><span
                  class="arial12Rusty">Date Opened:</span><br />
                  <span
                  class="arial11Black">04/2007 </span></td>
            <td valign="top" align="left" width="50%"><span
                  class="arial12Rusty">Type:</span><br />
                  <span
                  class="arial11Black">Revolving </span></td>
          </tr>
          <tr>
            <td valign="top" align="left" width="50%"><span
                  class="arial12Rusty">Reported Since:</span><br />
                  <span
                  class="arial11Black">07/2008 </span></td>
            <td valign="top" align="left" width="50%"><span
                  class="arial12Rusty">Terms:</span> <br />
                  <span
                  class="arial11Black">NA </span></td>
          </tr>
          <tr>
            <td valign="top" align="left" width="50%"><span
                  class="arial12Rusty">Date of Status:</span><br />
                  <span
                  class="arial11Black">07/2008 </span></td>
            <td valign="top" align="left" width="50%"><span
                  class="arial12Rusty">Monthly Payment:</span><br />
                  <span
                  class="arial11Black">$0 </span></td>
          </tr>
          <tr>
            <td valign="top" align="left" width="50%"><span
                  class="arial12Rusty">Last Reported:</span><br />
                  <span
                  class="arial11Black">07/2008 </span></td>
            <td valign="top" align="left" width="50%"><span
                  class="arial12Rusty">Responsibility:</span><br />
                  <span
                  class="arial11Black">Individual </span><br /></td>
          </tr>
        </tbody>
      </table></td>
      <td width="1.54%"></td>
      <td valign="top" align="left" width="49.23%"><table id="CDFTradeDetailFull4" cellspacing="0" cellpadding="0"
            width="100%" summary="" border="0">
        <tbody>
          <tr>
            <td valign="top" align="left" width="100%"><span
                  class="arial12Rusty">Credit Limit/Original
              Amount:</span><br />
              <span class="arial11Black">NA </span></td>
          </tr>
          <tr>
            <td valign="top" align="left" width="100%"><span
                  class="arial12Rusty">High Balance:</span><br />
                  <span
                  class="arial11Black">$129 </span></td>
          </tr>
          <tr>
            <td valign="top" align="left" width="100%"><span
                  class="arial12Rusty">Recent Balance:</span><br />
                  <span
                  class="arial11Black">$129 as of 07/2008 </span></td>
          </tr>
          <tr>
            <td valign="top" align="left" width="100%"><span
                  class="arial12Rusty">Recent Payment:</span><br />
                  <span
                  class="arial11Black">$0 </span></td>
          </tr>
        </tbody>
      </table></td>
    </tr>
    <tr>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="1.54%" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
    </tr>
    <tr>
      <td valign="top" align="left" width="49.23%"><span
            class="arial12Rusty">Creditor's statement:&nbsp;</span> <span
            class="arial11Black">Transferred to recovery. <br />
            <br />
      </span></td>
    </tr>
    <tr>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="1.54%" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
    </tr>
    <tr>
      <td valign="top" align="left" width="49.23%"><span
            class="arial12Rusty">Account History:</span><br />
          <span
            class="arial11Black">Charge Off as of Jul 2008<br />
            <br />
          </span></td>
      <td width="1.54%">&nbsp;</td>
      <td width="49.23%">&nbsp;</td>
    </tr>
    <tr>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="1.54%" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
      <td width="49.23%" bgcolor="#556aab" height="1"><img height="1" alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%" /></td>
    </tr>
  </tbody>
</table>
 
<!-- the following post must point at the correct url and ini-->
<TABLE id=CDFTradeDetailFull1 cellSpacing=0 cellPadding=0 width=650
      summary="" border=0>
        <TBODY>
        <TR>
          <TD class=arial11Black vAlign=bottom><BR><STRONG>ARROW FINANCIAL
            SERVICE </STRONG></TD>
          <TD></TD>
          <TD></TD></TR>
        <TR>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD>
          <TD width="1.54%" height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD></TR>
        <TR>
          <TD width="49.23%">
            <TABLE id=CDFTradeDetailFull2 cellSpacing=0 cellPadding=0
            width="100%" summary="" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top align=left width="50%"><SPAN
                  class=arial12Rusty>Address:&nbsp;</SPAN><BR><SPAN
                  class=arial11Black>5996 W TOUHY AVE<BR>NILES,
                  IL&nbsp;60714<BR>(800) 279-0224 <BR></SPAN></TD>
                <TD vAlign=top align=left width="50%"><SPAN
                  class=arial12Rusty>Account Number:</SPAN><BR><SPAN
                  class=arial11Black>42069899 </SPAN></TD></TR></TBODY></TABLE></TD>
          <TD width="1.54%"></TD>
          <TD vAlign=top align=left width="49.23%"><SPAN
            class=arial12Rusty>Original Creditor:</SPAN><BR><SPAN
            class=arial11Black>PREMIER BANKCARD INC.<BR><BR></SPAN></TD></TR>
        <TR>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/clear.gif"
          width="100%"></TD>
          <TD width="1.54%" height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/clear.gif"
          width="100%"></TD>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/clear.gif"
          width="100%"></TD></TR>
        <TR>
          <TD vAlign=top align=left width="49.23%"><SPAN
            class=arial12Rusty>Address Identification Number:</SPAN><BR><SPAN
            class=arial11Black>0054581419 </SPAN><BR></TD>
          <TD width="1.54%"></TD>
          <TD width="49.23%"></TD></TR>
        <TR>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD>
          <TD width="1.54%" height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD></TR>
        <TR>
          <TD vAlign=top align=left width="49.23%"><SPAN
            class=arial12Rusty>Status:&nbsp;</SPAN> <SPAN
            class=arial11Black>Collection account. $453 past due as of Jul 2008.
            </SPAN><BR></TD>
          <TD width="1.54%"></TD>
          <TD vAlign=top align=left width="49.23%"><SPAN
            class=arial12Rusty>Status Details:&nbsp;</SPAN> <SPAN
            class=arial11Black>This account is scheduled to continue on record
            until Sep 2012. <BR><BR><BR></SPAN></TD></TR>
        <TR>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD>
          <TD width="1.54%" height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD></TR>
        <TR>
          <TD vAlign=top align=left width="49.23%">
            <TABLE id=CDFTradeDetailFull3 cellSpacing=0 cellPadding=0
            width="100%" summary="" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top align=left width="50%"><SPAN
                  class=arial12Rusty>Date Opened:</SPAN><BR><SPAN
                  class=arial11Black>03/2008 </SPAN></TD>
                <TD vAlign=top align=left width="50%"><SPAN
                  class=arial12Rusty>Type:</SPAN><BR><SPAN
                  class=arial11Black>Collection </SPAN></TD></TR>
              <TR>
                <TD vAlign=top align=left width="50%"><SPAN
                  class=arial12Rusty>Reported Since:</SPAN><BR><SPAN
                  class=arial11Black>06/2008 </SPAN></TD>
                <TD vAlign=top align=left width="50%"><SPAN
                  class=arial12Rusty>Terms:</SPAN> <BR><SPAN
                  class=arial11Black>1 Months </SPAN></TD></TR>
              <TR>
                <TD vAlign=top align=left width="50%"><SPAN
                  class=arial12Rusty>Date of Status:</SPAN><BR><SPAN
                  class=arial11Black>06/2008 </SPAN></TD>
                <TD vAlign=top align=left width="50%"><SPAN
                  class=arial12Rusty>Monthly Payment:</SPAN><BR><SPAN
                  class=arial11Black>$0 </SPAN></TD></TR>
              <TR>
                <TD vAlign=top align=left width="50%"><SPAN
                  class=arial12Rusty>Last Reported:</SPAN><BR><SPAN
                  class=arial11Black>07/2008 </SPAN></TD>
                <TD vAlign=top align=left width="50%"><SPAN
                  class=arial12Rusty>Responsibility:</SPAN><BR><SPAN
                  class=arial11Black>Individual
          </SPAN><BR></TD></TR></TBODY></TABLE></TD>
          <TD width="1.54%"></TD>
          <TD vAlign=top align=left width="49.23%">
            <TABLE id=CDFTradeDetailFull4 cellSpacing=0 cellPadding=0
            width="100%" summary="" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top align=left width="100%"><SPAN
                  class=arial12Rusty>Credit Limit/Original
                  Amount:</SPAN><BR><SPAN class=arial11Black>$336 </SPAN></TD></TR>
              <TR>
                <TD vAlign=top align=left width="100%"><SPAN
                  class=arial12Rusty>High Balance:</SPAN><BR><SPAN
                  class=arial11Black>NA </SPAN></TD></TR>
              <TR>
                <TD vAlign=top align=left width="100%"><SPAN
                  class=arial12Rusty>Recent Balance:</SPAN><BR><SPAN
                  class=arial11Black>$453 as of 07/2008 </SPAN></TD></TR>
              <TR>
                <TD vAlign=top align=left width="100%"><SPAN
                  class=arial12Rusty>Recent Payment:</SPAN><BR><SPAN
                  class=arial11Black>$0 </SPAN></TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD>
          <TD width="1.54%" height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD></TR>
        <TR></TR>
        <TR>
          <TD vAlign=top align=left width="49.23%"><SPAN
            class=arial12Rusty>Account History:</SPAN><BR><SPAN
            class=arial11Black>Collection as of Jul 2008, Jun
          2008<BR><BR></SPAN></TD>
          <TD width="1.54%">&nbsp;</TD>
          <TD width="49.23%">&nbsp;</TD></TR>
        <TR>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD>
          <TD width="1.54%" height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD>
          <TD width="49.23%" bgColor=#556aab height=1><IMG height=1 alt=""
            src="Experian - Printable Full Report_files/bg_spacer.gif"
            width="100%"></TD></TR></TBODY></TABLE>
 
<!-- the following post must point at the correct url and ini-->
</body>
</html>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros