title: Format a string into columns in C
body: <p>I have a problem with getting this string to even out nicely into columns despite what size each of the strings are.  I've tried different formatting and other stuff; it's just not working. The way the function works is that before the <code>printCompanyTable</code> works, there's another function that updates all the string variables you see below, so I'm guessing that's where the problem might be, I think.</p>
  
  <pre><code>int printCompanyInfo() {  // this will print out the format for as long as I need it.
      char discount[30];
      char tax[30];
      if (discountTypeLookup == 0) {
          strcpy_s(discount, 30, "Not Applicable");
      }
      else if (discountTypeLookup == 1) {
          strcpy_s(discount, 30, "before Tax");
      }
      else if (discountTypeLookup == 2) {
          strcpy_s(discount, 30, "After Tax");
      }
      else if (discountTypeLookup == 3) {
          strcpy_s(discount, 30, "Before Tax &gt; 14,500");
      }
      if (payTaxLookup == 0) {
          strcpy_s(tax, 30, "No");
      }
      else if (payTaxLookup == 1) {
          strcpy_s(tax, 30, "Yes");
      }
      printf_s("%s %s %f %s %s %s\n", companyId, companyNameLookup, discountRateLookup, discount, tax, pickUpBayLookup);
      return(0);
  }
  </code></pre>