Sam
Sam

Reputation: 29

Increase width of <td>

How can I increase the width of a single <td> to 100% of the table?

I've tried width="100%" but It's not working.

Here's an example of what I want to achieve:

[enter image description here

HTML:

<div style="background-color:rgba(72,118,191,0.5);" class="lightblue step1"><h2 class="paddingh2">Step 1</h2><div class="form-item form-type-slider form-item-step-2">
  <label for="edit-step-2">How effective is your new business generation?</label>
</div>
<table class="bigtable">
    <tr>
  <td style="font-style: normal;">Currently</td>
   <td style="font-style: normal;">With a CRM</td>
    </tr>
    <tr>
        <td>You ranked your process</td>
        <td>Your process could be</td>
    </tr>
    <tr>
        <td><?php print $step1  . '/10'; ?></td>
        <td>9/10</td>
    </tr>
    <tr>
        <td>Your new business sales are:</td>
        <td>New business sales could increase by:</td>
    </tr>
    <tr>
        <td><?php print '£' . number_format($sales); ?></td>
        <td><?php print '£' . number_format($response1); ?></td>
    </tr>
<tr>
<td>How will a CRM help us generate more business?</td>
</tr>
<tr>
<td>Workbooks CRM improves new business by providing a single view of customers & prospects enabling you to drive specific marketing based on segmenting your lead data.

Reporting will enable management to ensure sales people are effective and following up leads and enquirers, whilst showing areas of potential focus (for example certain industries or marketing sources which bring in most leads).
</td>
    </table>
</div>

CSS

Upvotes: 0

Views: 457

Answers (1)

jacob21
jacob21

Reputation: 171

Each row needs the same number of columns. Your first row currently has two <td>, so two columns. The last two rows only have one <td>, so one column. You can set the cell to span multiple columns using the colspan attribute:

new code:

<div style="background-color:rgba(72,118,191,0.5);" class="lightblue step1"><h2 class="paddingh2">Step 1</h2><div class="form-item form-type-slider form-item-step-2">
  <label for="edit-step-2">How effective is your new business generation?</label>
</div>
<table class="bigtable">
    <tr>
  <td style="font-style: normal;">Currently</td>
   <td style="font-style: normal;">With a CRM</td>
    </tr>
    <tr>
        <td>You ranked your process</td>
        <td>Your process could be</td>
    </tr>
    <tr>
        <td><?php print $step1  . '/10'; ?></td>
        <td>9/10</td>
    </tr>
    <tr>
        <td>Your new business sales are:</td>
        <td>New business sales could increase by:</td>
    </tr>
    <tr>
        <td><?php print '£' . number_format($sales); ?></td>
        <td><?php print '£' . number_format($response1); ?></td>
    </tr>
<tr>
<td colspan="2">How will a CRM help us generate more business?</td>
</tr>
<tr>
<td colspan="2">Workbooks CRM improves new business by providing a single view of customers & prospects enabling you to drive specific marketing based on segmenting your lead data.

Reporting will enable management to ensure sales people are effective and following up leads and enquirers, whilst showing areas of potential focus (for example certain industries or marketing sources which bring in most leads).
</td>
    </table>
</div>

Upvotes: 1

Related Questions